Re: two seperate queries run faster than queries ORed

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: two seperate queries run faster than queries ORed
Дата
Msg-id 20040322113002.D62908@megazone.bigpanda.com
обсуждение исходный текст
Ответ на Re: two seperate queries run faster than queries ORed together  (Joseph Shraibman <jks@selectacast.net>)
Ответы Re: two seperate queries run faster than queries ORed together
Re: two seperate queries run faster than queries ORed
Список pgsql-performance
On Mon, 22 Mar 2004, Joseph Shraibman wrote:

> Tom Lane wrote:
> > Joseph Shraibman <jks@selectacast.net> writes:
> >
> >>No, pkey is not the primary key in this case. The number of entries in u
> >>that have pkey 260 and not boolfield is 344706.
> >
> >
> > ... and every one of those rows *must* be included in the join input,
>
> *If* you use one big join in the first place.  If postgres ran the query
> to first get the values with status == 3 from u, then ran the query to
> get the entries from d, then combined them, the result would be the same
> but the output faster.  Instead it is doing seq scans on both tables and

Well, you have to be careful on the combination to not give the wrong
answers if there's a row with u.status=3 that matches a row d.status=3.

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

Предыдущее
От: Joseph Shraibman
Дата:
Сообщение: Re: two seperate queries run faster than queries ORed together
Следующее
От: Joseph Shraibman
Дата:
Сообщение: Re: two seperate queries run faster than queries ORed together