Re: 2 Selects 1 is faster, why?
Keith Gray <keith@heart.com.au>
From: Keith Gray <keith@heart.com.au>
To: Masaru Sugawara <rk73@sea.plala.or.jp>
Cc: Alvar Freude <alvar@a-blast.org>, pgsql-sql@postgresql.org
Date: 2002-06-27T23:40:46Z
Lists: 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