summaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeIndexonlyscan.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2012-01-25 20:40:34 -0500
committerRobert Haas <rhaas@postgresql.org>2012-01-25 20:41:52 -0500
commit9f9135d129e915e72c8a2f770689fd72619ead49 (patch)
tree644c9d0a29e9ccc7b2fd21a00931d62d7bd5094c /src/backend/executor/nodeIndexonlyscan.c
parent08146775acd8bfe0fcc509c71857abb928697171 (diff)
Instrument index-only scans to count heap fetches performed.
Patch by me; review by Tom Lane, Jeff Davis, and Peter Geoghegan.
Diffstat (limited to 'src/backend/executor/nodeIndexonlyscan.c')
-rw-r--r--src/backend/executor/nodeIndexonlyscan.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/backend/executor/nodeIndexonlyscan.c b/src/backend/executor/nodeIndexonlyscan.c
index 7f1100e15e4..4abd805aa31 100644
--- a/src/backend/executor/nodeIndexonlyscan.c
+++ b/src/backend/executor/nodeIndexonlyscan.c
@@ -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