Mysql – Why is the index not being used?
I have a table (say table t) with an index on col_a that is unique. Now the index on col_a is used in these 2 following cases - SELECT * from t WHERE(col_a,col_b) IN((x,y),(p,q)); - query_1 SELECT * from t…
I have a table (say table t) with an index on col_a that is unique. Now the index on col_a is used in these 2 following cases - SELECT * from t WHERE(col_a,col_b) IN((x,y),(p,q)); - query_1 SELECT * from t…
Trying to create a conditional unique index in postgresql but unable to do so and getting this error Query 1 ERROR: ERROR: cannot use subquery in index predicate LINE 3: WHERE ( ^ this is how my query looks like…
I am wondering if the following MySql SELECT query takes O(N) or O(logN). Let us we have a table represents 4 integer intervals [startNum, endNum]. And the table is indexed by the startNum and endNum columns. startNum, endNum 3, 8…