I am using a DBD::SQLite in memory database. I have defined the following indexes for a table:
CREATE INDEX x ON ss (a, b);
CREATE INDEX y ON ss (c, d, e, o);
Will the following select statement use these two indexes?
SELECT f, g
FROM ss
WHERE a = ? AND b = ? AND c = ? AND d = ? AND e = ?
And, I should only make indexes on those columns in the where clause?
I ask this just because I want to run more SELECT with minimal INDEX.
SELECT f, g FROM ss WHERE o = ?
SELECT f, g FROM ss WHERE a = ? AND b = ?
SELECT f, g FROM ss WHERE c = ? AND d = ? AND e = ?
SELECT f, g FROM ss WHERE c = ? AND d = ? AND o = ?
SELECT f, g FROM ss WHERE a = ? AND b = ? AND c = ? AND d = ? AND e = ?