If I built a btree index on columns (one, two, three, four, five)
will it be used for a query with where block:
(1) ... WHERE one = 1 AND two = 2 AND three = 3 AND four = 4 -- no five
or
(2) ... WHERE two = 2 AND one = 1 -- wrong sequence, no five
or
(3) ... WHERE one = 1 AND three = 3 AND two = 2 AND five = 5 AND four = 4 -- wrong sequence
Yes in all your cases, because databases don’t generally worry about the order of statements in your WHERE clause.
However, it’s not likely to be used
Because one is the first component of your index, but doesn’t appear in your where clause