| От | Bruno Wolff III |
|---|---|
| Тема | Re: partial index on boolean, problem with v8.0.0rc1 |
| Дата | |
| Msg-id | 20041213185905.GA11248@wolff.to обсуждение исходный текст |
| Ответ на | partial index on boolean, problem with v8.0.0rc1 (Igor Shevchenko <igor@carcass.ath.cx>) |
| Список | pgsql-general |
On Mon, Dec 13, 2004 at 20:18:57 +0200, Igor Shevchenko <igor@carcass.ath.cx> wrote: > > Here's the problem: in the 2nd case, planner wouldn't choose an index scan > using partial index on "is_read" for the following queries: > > explain select * from user_msg where is_read=true; > explain select * from user_msg where is_read is true; > explain select * from user_msg where is_read; > > In the 1st case, partial index was used for the first query. Note that whatever = TRUE is not equivalent to whatever IS TRUE. The latter will return FALSE if whatever is NULL, while the former will return NULL in that case. There are also some limitations on the optimizer recognizing equivalent varients of an expression. This might cause a problem with the third select example.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера