forked from greenplum-db/gpdb-archive
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ORCA] Support cover indexes using INCLUDE columns (#15463)
Indexes in ORCA are composed of a set of KEY columns and a separate set of INCLUDE columns. KEY columns determine the search pattern of the index, whereas INCLUDE columns represents the columns accessible in an index scan. Naturally, the two sets should have some overlap. In Postgres, cover indexes [1] were introduced in commit 8224de4. Cover indexes store additional non-key columns in the physical index storage to avoid incurring additional page accesses to the backend relation files during an index-only scan. ORCA's definition of an index's included columns predates Postgres cover index feature. However, ORCA's current implementation of include columns is pointless as it has always assumed that all columns in the table are available from the index. I think that cover indexes were disabled in ORCA [2] in Postgres 12 merge due to a conflated definition of included columns. In reality, Postgres's definition of included columns fits almost seamlessly into ORCA's framework. This commit updates ORCA to adopt the Postgres definition. Used following sed script to remove the IncludedColumns in old MDPs: $ git grep -l 'IncludedColumns' -- *.xml -- *.mdp | xargs sed -ie 's/IncludedColumns="\(.*\)"/IncludedColumns=""/g' Previously IncludedColumns represented all columns in the table. That doesn't seem useful. Now it is being used to store cover index columns so remove it from all pre-existing MDPs that were created before the cover index was supported. [1] https://www.postgresql.org/docs/12/indexes-index-only-scans.html [2] greenplum-db/gpdb-postgres-merge-Archived@b1c1eee0a8
- Loading branch information
Showing
255 changed files
with
3,905 additions
and
571 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.