[PERFORM] The usual sequential scan, but with LIMIT !

2004-09-06 Thread Pierre-Frdric Caillaud
Hello, I have this table : CREATE TABLE apparts ( id SERIAL NOT NULL PRIMARY KEY, priceFLOAT NOT NULL, surfaceINTEGER NOT NULL, price_sq FLOAT NOT NULL, roomsINTEGER NULL, vente

Re: [PERFORM] Multiple Uniques

2004-09-06 Thread Markus Schaber
Hi, Greg, On 02 Sep 2004 15:33:38 -0400 Greg Stark [EMAIL PROTECTED] wrote: Markus Schaber [EMAIL PROTECTED] writes: logigis=# explain select count(id) from (select ref_in_id as id from streets union select nref_in_id as id from streets) as blubb;

Re: [PERFORM] The usual sequential scan, but with LIMIT !

2004-09-06 Thread Tom Lane
=?iso-8859-15?Q?Pierre-Fr=E9d=E9ric_Caillaud?= [EMAIL PROTECTED] writes: Now, if I LIMIT the query to 10 rows, the index should be used all the time, because it will always return few rows... well, it doesn't ! Not at all. From the planner's point of view, the LIMIT is going to reduce the