mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
Instrument index-only scans to count heap fetches performed.
Patch by me; review by Tom Lane, Jeff Davis, and Peter Geoghegan.
This commit is contained in:
@ -90,6 +90,7 @@ IndexOnlyNext(IndexOnlyScanState *node)
|
||||
/*
|
||||
* Rats, we have to visit the heap to check visibility.
|
||||
*/
|
||||
node->ioss_HeapFetches++;
|
||||
tuple = index_fetch_heap(scandesc);
|
||||
if (tuple == NULL)
|
||||
continue; /* no visible tuple, try next index entry */
|
||||
@ -346,6 +347,7 @@ ExecInitIndexOnlyScan(IndexOnlyScan *node, EState *estate, int eflags)
|
||||
indexstate = makeNode(IndexOnlyScanState);
|
||||
indexstate->ss.ps.plan = (Plan *) node;
|
||||
indexstate->ss.ps.state = estate;
|
||||
indexstate->ioss_HeapFetches = 0;
|
||||
|
||||
/*
|
||||
* Miscellaneous initialization
|
||||
|
Reference in New Issue
Block a user