Skip to content

Fixes 5059 add brin gist #5124

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

Merged
merged 4 commits into from
Apr 8, 2024

Conversation

griffio
Copy link
Collaborator

@griffio griffio commented Apr 5, 2024

fixes #5059

  • Updated CREATE INDEX to support operator classes e.g jsonb_path_ops, storage parameters e.g gin_pending_list_limit and index methods for BRIN, BTREE, GIN, GIST, HASH

  • Added integration tests for index methods and storage parameters

There are many op classes and it may not be possible to validate them, extra ones are added by extensions, and the data types they support

The optional WITH clause specifies storage parameters for the index. Each index method has its own set of allowed storage parameters. https://www.postgresql.org/docs/16/sql-createindex.html#SQL-CREATEINDEX-STORAGE-PARAMETERS

Index storage parameters are possible to validate, along with the arguments

'autosummarize' | 'buffering' | 'deduplicate_items' | 'fastupdate' | 'fillfactor' | 'gin_pending_list_limit' | 'pages_per_range'

e.g

CREATE INDEX gin_alpha ON json_gin USING GIN (alpha jsonb_path_ops) WITH (gin_pending_list_limit = 2048);

Added CreateIndexMixin to annotate errors with storage parameters
Updated fixtures with different index methods and invalid options

📔 ALTER INDEX is not currently implemented in any grammar as is non-standard (as sqlite doesn't support ALTER INDEX)

Currently DROP INDEX must be used instead

griffio added 4 commits April 5, 2024 14:04
Add operator classes e.g jsonb_ops
Add index method e.g GIST
Add storage parameters e.g fastupdate
For annotation
Currently validates the storage parameters
@griffio griffio marked this pull request as ready for review April 7, 2024 18:10
@AlecKazakova AlecKazakova merged commit 5444254 into sqldelight:master Apr 8, 2024
@griffio griffio deleted the fixes-5059-add-brin-gist branch July 10, 2024 17:17
@justin-robinson
Copy link

@griffio what can I do to get this in a new release? Not having hash indexes is a blocker for a performance issue we have.

@griffio
Copy link
Collaborator Author

griffio commented Aug 24, 2024

@griffio what can I do to get this in a new release? Not having hash indexes is a blocker for a performance issue we have.

@justin-robinson Last release was April, I don't think there is a schedule, it's when the maintainers have time to create a release - however I use the snapshot version as this always has merged fixes/features on master and this will be the next released version anyway.

see example for snapshot https://github.com/griffio/sqldelight-postgres-01/blob/master/build.gradle.kts

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

Successfully merging this pull request may close these issues.

PostgreSql Dialect add USING BRIN/GIST to CREATE INDEX statement
3 participants