Simon Riggs <[EMAIL PROTECTED]> writes:
> Sweating over the logic of the theorem prover, I notice it doesn't
> actually bother to complete an accurate test.

Sure it does.

> create index idx1 on tenk (col1) where col1 > 1 and col1 < 10;

> explain select * from tenk where col1 > 5 and col1 < -5;
> [ uses that index ]

This is a perfectly legitimate situation.  "col1 > 5" implies "col1 > 1"
and "col1 < -5" implies "col1 < 10", therefore the query WHERE condition
implies the index predicate, therefore the index contains all tuples
that could pass the WHERE condition, therefore the index is usable.

Kindly do not break this.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [EMAIL PROTECTED] so that your
       message can get through to the mailing list cleanly

Reply via email to