Suppose there is a table with three columns A, B and C. A is the primary key. I have two types of queries, one of which searches for A and B, and the other for A and C. It is better to add an additional index for C to search based on A and C or create a new table with columns A, C and B.
To express this in a different perspective, it is generally a bad idea to have two secondary indexes in two columns and have a where where clause for both indices. Is this the same case for combining a primary key and a secondary index?
https://www.youtube.com/watch?v=CbeRmb8fI9s#t=56
https://www.youtube.com/watch?v=N6UY1y3dgAk#t=30
source
share