Re: 2 Selects 1 is faster, why?

Поиск
Список
Период
Сортировка
От Keith Gray
Тема Re: 2 Selects 1 is faster, why?
Дата
Msg-id 3D1BA27E.9000802@heart.com.au
обсуждение исходный текст
Ответ на 2 Selects 1 is faster, why?  ("Eric" <emayo@pozicom.net>)
Ответы Re: 2 Selects 1 is faster, why?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
Masaru Sugawara wrote:

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

...but is it true that if you place the filter clause first,
the join will not have to complete the whole table?

eg.

SELECT item.description, stock.available
FROM item, stock
WHERE item.itemid = '1234'
AND item.itemid=stock.itemid;

...would be more efficient than,

SELECT item.description, stock.available
FROM item, stock
WHERE item.itemid=stock.itemid
AND item.itemid = '1234';


-- 
Keith Gray

Technical Services Manager
Heart Consulting Services P/L
mailto:keith@heart.com.au





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

Предыдущее
От: David Secret
Дата:
Сообщение: Unsubscription -- How?
Следующее
От: Tatsuo Ishii
Дата:
Сообщение: Re: Slow SELECT -> Growing Database