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

[feat] migration should support partial index #872

Closed
onichandame opened this issue Jul 14, 2022 · 4 comments
Closed

[feat] migration should support partial index #872

onichandame opened this issue Jul 14, 2022 · 4 comments

Comments

@onichandame
Copy link
Contributor

Motivation

Sqlite supports a WHERE clause on creating an index. see docs

This feature is useful if only a subset of rows need to be indexed. Without it the index must cover all rows, which unnecessarily consumes more disk space.

Proposed Solutions

Something like sea_query::Index::create().filter(<Condition>) for use with entities, and sea_query::Index::create().filter_raw("<Where Clause>") for more freedom.

Additional Information

@billy1624
Copy link
Member

Hey @onichandame, thanks for the proposal!

As far as I know, both SQLite and PostgreSQL supported partial index, docs:

But MySQL doesn't support it. I think we could introduce this feature in SeaQuery as 2 out of 3 databases support it.

Thoughts? @tyt2y3 @ikrivosheev

@tyt2y3
Copy link
Member

tyt2y3 commented Jul 17, 2022

Agreed

@billy1624
Copy link
Member

Alright, I take that as a go! I open a tracking issue on SeaQL/sea-query#396

@tyt2y3
Copy link
Member

tyt2y3 commented Feb 21, 2023

Reason to close: this issue has been moved to SeaQuery

@tyt2y3 tyt2y3 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants