Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Postgres BTree index INCLUDE (<col>, ...) #775

Open
theelderbeever opened this issue Apr 29, 2024 · 0 comments · May be fixed by #826
Open

Support for Postgres BTree index INCLUDE (<col>, ...) #775

theelderbeever opened this issue Apr 29, 2024 · 0 comments · May be fixed by #826

Comments

@theelderbeever
Copy link
Contributor

Motivation

Postgres BTree indexex allow for an INCLUDE statement where the included columns values are stored in the leaf nodes of the index. This is an optimization to store data with the index for columns that are fetched commonly but, not necessarily filtered on.

Proposed Solutions

Index::create()
        .name(name)
        .index_type(IndexType::BTree)
        .table(table)
        .col(col)
        .include(other_cols) // postgres feature gate
        .is_unique_key();
CREATE UNIQUE INDEX an_index ON table USING BTREE (col) INCLUDE (other_cols)

Additional Information

I am unsure if this is supported on other databases.

CREATE INDEX

@yuly3 yuly3 linked a pull request Oct 5, 2024 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant