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 index-only scans on our hnsw access method #161

Open
Ngalstyan4 opened this issue Sep 19, 2023 · 3 comments
Open

Support index-only scans on our hnsw access method #161

Ngalstyan4 opened this issue Sep 19, 2023 · 3 comments
Labels
core Core Database

Comments

@Ngalstyan4
Copy link
Contributor

Note: this is quite an involved issue. It will require understanding of the index storage format and structures on postgres blocks.

Relevant links:

@Ngalstyan4 Ngalstyan4 added the core Core Database label Sep 19, 2023
@Posrabi
Copy link

Posrabi commented Sep 26, 2023

So if I understand this correctly, the hnsw index type does not support index-only and we want to implement it? Ref:

The index type must support index-only scans. B-tree indexes always do. GiST and SP-GiST indexes support index-only scans for some operator classes but not others. Other index types have no support. The underlying requirement is that the index must physically store, or else be able to reconstruct, the original data value for each index entry. As a counterexample, GIN indexes cannot support index-only scans because each index entry typically holds only part of the original data value.

@Posrabi
Copy link

Posrabi commented Sep 26, 2023

And this can be achieved by properly supporting the INCLUDE expression on the CREATE INDEX statement.

@Posrabi
Copy link

Posrabi commented Sep 27, 2023

Access methods API descriptions: https://www.postgresql.org/docs/9.5/catalog-pg-am.html
I think as a first step we can implement amcanreturn and then support INCLUDE later. Effectively if we only query the column cover by the index then we would still be doing an index-only scan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core Database
Projects
None yet
Development

No branches or pull requests

2 participants