mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
Support index-only scans using the visibility map to avoid heap fetches.
When a btree index contains all columns required by the query, and the visibility map shows that all tuples on a target heap page are visible-to-all, we don't need to fetch that heap page. This patch depends on the previous patches that made the visibility map reliable. There's a fair amount left to do here, notably trying to figure out a less chintzy way of estimating the cost of an index-only scan, but the core functionality seems ready to commit. Robert Haas and Ibrar Ahmed, with some previous work by Heikki Linnakangas.
This commit is contained in:
@ -1226,6 +1226,7 @@ typedef struct
|
||||
* RuntimeContext expr context for evaling runtime Skeys
|
||||
* RelationDesc index relation descriptor
|
||||
* ScanDesc index scan descriptor
|
||||
* VMBuffer buffer in use for visibility map testing, if any
|
||||
* ----------------
|
||||
*/
|
||||
typedef struct IndexScanState
|
||||
@ -1242,6 +1243,7 @@ typedef struct IndexScanState
|
||||
ExprContext *iss_RuntimeContext;
|
||||
Relation iss_RelationDesc;
|
||||
IndexScanDesc iss_ScanDesc;
|
||||
Buffer iss_VMBuffer;
|
||||
} IndexScanState;
|
||||
|
||||
/* ----------------
|
||||
|
Reference in New Issue
Block a user