Re: 2 Selects 1 is faster, why?

Поиск
Список
Период
Сортировка
От Masaru Sugawara
Тема Re: 2 Selects 1 is faster, why?
Дата
Msg-id 20020627234531.7ECB.RK73@sea.plala.or.jp
обсуждение исходный текст
Ответ на Re: 2 Selects 1 is faster, why?  (Alvar Freude <alvar@a-blast.org>)
Список pgsql-sql
On Wed, 26 Jun 2002 17:34:47 +0200
Alvar Freude <alvar@a-blast.org> wrote:


> Hi,
> 
> -- Eric <emayo@pozicom.net> wrote:
> 
> > If I perform the following 2 selects, the first one is EXTREMELY slow
> > where the 2nd one is very fast.
> 
> [...] 
> 
> > Why would 2 be so much faster?  I have ran the EXPLAIN on this and index
> > scans are being used.
> 
> I guess, the first query has to search for all ol.orderid the equivalent
> o.orderid; the second variant only has to search for '1234' in each
> ?.orderid, which is much faster.

You are right. And this type of optimising are not yet implemented.Tom said it in the prior discussions. 



Regards,
Masaru Sugawara






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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: CHECK clause doesn't work with CASE clause
Следующее
От: Richard Poole
Дата:
Сообщение: Re: CHECK clause doesn't work with CASE clause