Re: Strange logic for partial index proving - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Strange logic for partial index proving
Date
Msg-id 1119389626.3645.423.camel@localhost.localdomain
Whole thread Raw
In response to Re: Strange logic for partial index proving  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Strange logic for partial index proving
List pgsql-hackers
On Tue, 2005-06-21 at 16:29 -0400, Tom Lane wrote:
> > 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.  

Like I said, its correct. I didn't suggest changing it.

> "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.

..."all tuples that pass the WHERE condition", like none.

Guess I'm not Mr Logic.

Best Regards, Simon Riggs





pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: PROPOSAL FE/BE extension to handle IN/OUT parameters
Next
From: Alvaro Herrera
Date:
Subject: Re: Why is checkpoint so costly?