7 comments:

Based on what you wrote it's possible to remove the field1_field2_idx and have instead field1_idx and field2_idx. Which will result in less wasted space 'cause field1_idx will be a lot smaller than field1_field2_idx.

Hi Yuli,you can use the First index only if you just run the SQL SELECT COUNT(*) from table1 WHERE field1 IN ('val1','val2'); SELECT COUNT(*) from table1 WHERE field2 IN ('val3','val4')AND field1 NOT IN ('val1','val2');That will save you having both indexes, but may give you slower performance.