Re: Strange logic for partial index proving
| От | Simon Riggs |
|---|---|
| Тема | Re: Strange logic for partial index proving |
| Дата | |
| Msg-id | 1119389626.3645.423.camel@localhost.localdomain обсуждение исходный текст |
| Ответ на | Re: Strange logic for partial index proving (Tom Lane <tgl@sss.pgh.pa.us>) |
| Ответы |
Re: Strange logic for partial index proving
|
| Список | 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 по дате отправления: