-
- Downloads
Rearrange the implementation of index-only scans.
This commit changes index-only scans so that data is read directly from the index tuple without first generating a faux heap tuple. The only immediate benefit is that indexes on system columns (such as OID) can be used in index-only scans, but this is necessary infrastructure if we are ever to support index-only scans on expression indexes. The executor is now ready for that, though the planner still needs substantial work to recognize the possibility. To do this, Vars in index-only plan nodes have to refer to index columns not heap columns. I introduced a new special varno, INDEX_VAR, to mark such Vars to avoid confusion. (In passing, this commit renames the two existing special varnos to OUTER_VAR and INNER_VAR.) This allows ruleutils.c to handle them with logic similar to what we use for subplan reference Vars. Since index-only scans are now fundamentally different from regular indexscans so far as their expression subtrees are concerned, I also chose to change them to have their own plan node type (and hence, their own executor source file).
Showing
- src/backend/commands/explain.c 79 additions, 40 deletionssrc/backend/commands/explain.c
- src/backend/commands/trigger.c 4 additions, 4 deletionssrc/backend/commands/trigger.c
- src/backend/executor/Makefile 2 additions, 1 deletionsrc/backend/executor/Makefile
- src/backend/executor/execAmi.c 20 additions, 1 deletionsrc/backend/executor/execAmi.c
- src/backend/executor/execCurrent.c 1 addition, 0 deletionssrc/backend/executor/execCurrent.c
- src/backend/executor/execProcnode.c 14 additions, 0 deletionssrc/backend/executor/execProcnode.c
- src/backend/executor/execQual.c 16 additions, 8 deletionssrc/backend/executor/execQual.c
- src/backend/executor/execScan.c 8 additions, 1 deletionsrc/backend/executor/execScan.c
- src/backend/executor/execUtils.c 8 additions, 4 deletionssrc/backend/executor/execUtils.c
- src/backend/executor/nodeAgg.c 2 additions, 2 deletionssrc/backend/executor/nodeAgg.c
- src/backend/executor/nodeBitmapIndexscan.c 0 additions, 1 deletionsrc/backend/executor/nodeBitmapIndexscan.c
- src/backend/executor/nodeHash.c 2 additions, 2 deletionssrc/backend/executor/nodeHash.c
- src/backend/executor/nodeIndexonlyscan.c 542 additions, 0 deletionssrc/backend/executor/nodeIndexonlyscan.c
- src/backend/executor/nodeIndexscan.c 17 additions, 125 deletionssrc/backend/executor/nodeIndexscan.c
- src/backend/executor/nodeNestloop.c 2 additions, 2 deletionssrc/backend/executor/nodeNestloop.c
- src/backend/nodes/copyfuncs.c 28 additions, 1 deletionsrc/backend/nodes/copyfuncs.c
- src/backend/nodes/outfuncs.c 19 additions, 3 deletionssrc/backend/nodes/outfuncs.c
- src/backend/nodes/print.c 6 additions, 2 deletionssrc/backend/nodes/print.c
- src/backend/optimizer/path/indxpath.c 11 additions, 12 deletionssrc/backend/optimizer/path/indxpath.c
- src/backend/optimizer/path/pathkeys.c 10 additions, 58 deletionssrc/backend/optimizer/path/pathkeys.c
Loading
Please register or sign in to comment