|< < 56 > >|

Postgres MVCC

Index improvements

Index-only scans

  • Was not possible in Postgres until recently.

  • Still not always possible.

  • Does the value still exist in the indexed row?

Index-only scans were enabled with visibility maps (Postgres 9.2).

For a key [k1, ..., kn]:

  • Search index for relevant keys. For each ([k1, ... ,kn], ctid) pair:
    • If visibility map indicates that page(ctid) has not been updated recently, then the components of [k1, ... ,kn] are current.
    • Otherwise, read the page and check to see if the indexed row is current.

|< < 56 > >|