This is kind of evolving an idea used in null_indexes. Additionally to suggesting partial indexes when we have a lot of NULLs in the column, we can suggest partial indexes for columns where we have a high % of the same value.
For example, for the table with millions of users an index on role was added (to quickly find admins, for example). But 99% of the users are regular users, several are admins, moderators, etc. So the partial index where role != 'regular' would be beneficial.
This is kind of evolving an idea used in
null_indexes
. Additionally to suggesting partial indexes when we have a lot ofNULL
s in the column, we can suggest partial indexes for columns where we have a high % of the same value.For example, for the table with millions of users an index on
role
was added (to quickly find admins, for example). But 99% of the users are regular users, several are admins, moderators, etc. So the partial indexwhere role != 'regular'
would be beneficial.