Re: Optimizer & boolean syntax

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Optimizer & boolean syntax
Дата
Msg-id 20021121133645.O99444-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Optimizer & boolean syntax  (Daniele Orlandi <daniele@orlandi.com>)
Список pgsql-hackers
On Thu, 21 Nov 2002, Daniele Orlandi wrote:

> Are those two syntaxes eqivalent ?
>
> select * from users where monitored;
> select * from users where monitored=true;
>
> If the answer is yes, the optimimer probably doesn't agree with you :)

That depends on the definition of equivalent.  They presumably give the
same answer (I'm assuming monitored is a boolean), but the latter has
something that's considered an indexable condition and I believe the
former does not (even with enable_seqscan=off the former syntax
appears to give a sequence scan, usually a good sign it's not considered
indexable).



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Treat
Дата:
Сообщение: Re: Optimizer & boolean syntax
Следующее
От: "scott.marlowe"
Дата:
Сообщение: Re: [GENERAL] Bug with sequence