[prev] 29 [next]

Scanning in PostgreSQL

Scanning defined in: backend/access/heap/heapam.c

Implements iterator data/operations:

  • HeapScanDesc ... struct containing iteration state
  • scan = heap_beginscan(rel,...,nkeys,keys)
    (uses initscan() to do half the work (shared with rescan))
  • tup = heap_getnext(scan, direction)
    (uses heapgettup() to do most of the work)
  • heap_endscan(scan) ... frees up scan struct
  • HeapKeyTest() ... implements key match test