Re: How to avoid "Seq Scans"?

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to avoid "Seq Scans"?
Date: 2007-08-29 09:29:21
Message-ID: 20070829092921.GB7841@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2007-08-29 09:31:18 Re: How to avoid "Seq Scans"?
Previous Message Richard Huxton 2007-08-29 09:20:53 Re: How to avoid "Seq Scans"?