active_record_doctor
active_record_doctor copied to clipboard
Suggestion regarding indexes on boolean fields
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.
Great idea. Let's wait with development until I clear up the PR backlog.