I have a huge table, having a much smaller number (by orders of magnitude) of distinct values on some column x.
x
I need to do a query like SELECT D
SELECT D
If your column x has low cardinality, creating local bitmap index would increase the performance many fold.