Can multi indexing speed up "AND" of comparisons? I am using PostgreSQL and have query of type:

SELECT * from t
WHERE a &gt; 30 AND b &lt; 20


where a and b are columns of table t. I have indexed columns a and b. Would that speed up this query or do I need to add a multi index (a, b)?

This post mentions that multi index speeds up query of type a = 3 and b = 4 and a = 3 but I am not sure if same applies for comparisons.

Also official PostgreSQL docs says that it can speed up queries of type SELECT name FROM test2 WHERE major = constant AND minor = constant, but in the later text it says many things which I don't really understand and hence asking this question here.
A multi-column index cannot be used for both conditions. For example, an index on (a, b) could be used for the condition a &gt; 30, but not for b &lt; 20.

If one of the conditions alone is selective enough and the other does not reduce the result set considerably, just create an index for that condition.

If you need index support for both conditions because neither of them is selective enough on its own, create two indexes, one for each condition. Then PostgreSQL can use a bitmap index scan on both indexes and a &ldquo;bitmap or&rdquo; to combine the results.