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

Suggestion regarding indexes on boolean fields #109

Open
fatkodima opened this issue Jul 20, 2022 · 1 comment
Open

Suggestion regarding indexes on boolean fields #109

fatkodima opened this issue Jul 20, 2022 · 1 comment

Comments

@fatkodima
Copy link
Contributor

Indexes on booleans are not as useful as people tend to think. On my laptop using postgres (default configuration) index was only used when <= 20% of rows satisfied the target value.

Most of the time, people add indexes for boolean columns like admin, deleted, banned, which have a distribution of 1% vs 99%, so the partial index would help.

So, I propose to suggest removing indexes on boolean fields or make them partial.

@gregnavis
Copy link
Owner

Great idea. Let's wait with development until I clear up the PR backlog.

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

No branches or pull requests

2 participants