Re: How to avoid "Seq Scans"? - Mailing list pgsql-general

From A. Kretschmer
Subject Re: How to avoid "Seq Scans"?
Date
Msg-id 20070829092921.GB7841@a-kretschmer.de
Whole thread Raw
In response to How to avoid "Seq Scans"?  (Vincenzo Romano <vincenzo.romano@gmail.com>)
List pgsql-general
am  Wed, dem 29.08.2007, um 11:15:21 +0200 mailte Vincenzo Romano folgendes:
> This loop is increadibly slow. Infact the friendly explain tells me
> that:
>
> test=# explain select * from t order by f2,f3;
>                                    QUERY PLAN
> ---------------------------------------------------------------------------------
>  Sort  (cost=958786.20..970734.55 rows=4779338 width=28)
>    Sort Key: f2,f3
>    ->  Seq Scan on t  (cost=0.00..85501.38 rows=4779338 width=28)
>
> I'd like to know a hint about a technicque to avoid the sequential
> scan!

A 'select foo from bar' without a WHERE-condition forces a seq-scan
because _YOU_ want the whole table.


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: How to avoid "Seq Scans"?
Next
From: Martijn van Oosterhout
Date:
Subject: Re: How to avoid "Seq Scans"?