Re: 2 Selects 1 is faster, why? - Mailing list pgsql-sql

From Keith Gray
Subject Re: 2 Selects 1 is faster, why?
Date
Msg-id 3D1BA27E.9000802@heart.com.au
Whole thread Raw
In response to 2 Selects 1 is faster, why?  ("Eric" <emayo@pozicom.net>)
Responses Re: 2 Selects 1 is faster, why?
List 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 by date:

Previous
From: David Secret
Date:
Subject: Unsubscription -- How?
Next
From: Tatsuo Ishii
Date:
Subject: Re: Slow SELECT -> Growing Database