Re: Optimizer & boolean syntax

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема Re: Optimizer & boolean syntax
Дата
Msg-id 003101c291a9$525b4950$6600a8c0@internal
обсуждение исходный текст
Ответ на Re: Optimizer & boolean syntax  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Ответы Re: Optimizer & boolean syntax  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-hackers
> > 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).

I think his point is that they _should_ be equivalent.  Surely there's
something in the optimiser that discards '=true' stuff, like 'a=a' should be
discarded?

Chris




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

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