active_record_doctor icon indicating copy to clipboard operation
active_record_doctor copied to clipboard

Suggestion regarding indexes on boolean fields

Open fatkodima opened this issue 2 years ago • 1 comments

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.

fatkodima avatar Jul 20 '22 11:07 fatkodima

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

gregnavis avatar Jul 20 '22 14:07 gregnavis