I have a table with columns
A will always be used in every query and only one of
B24. A large subset of the
B columns (more than half) will generally be queried more than the rest, but all of them will be used fairly frequently.
Should I create indexes on 24 two-tuples of
(A, B1) ...
Or 1 huge composite index encompassing all the columns?
If I'm creating a lot of indexes, at what point am I adding too many indexes to the table and what is the approach to working that out? The table is used in a lot of core functionality and will be queried very frequently.
B columns will only be filtered by
true, and generally only one
B column will be used in a single query. So the where clause of the query will generally look like:
... WHERE A = '2018-11-22' AND B12