Re: Queries not using Index

From: Daryl Herzmann <akrherz(at)iastate(dot)edu>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Queries not using Index
Date: 2002-07-24 01:57:15
Message-ID: Pine.LNX.4.44.0207232050230.1226-100000@12-216-9-13.client.mchsi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

>You _have_ actually run ANALYZE on the table, right?

snet=# vacuum analyze t2002_06;
VACUUM
snet=# vacuum analyze;
VACUUM
snet=# explain analyze select * from t2002_06 WHERE station = 'SAMI4';
NOTICE: QUERY PLAN:

Seq Scan on t2002_06 (cost=0.00..35379.69 rows=35169 width=47) (actual
time=20.51..1717.78 rows=38146 loops=1)
Total runtime: 1730.63 msec

EXPLAIN
snet=# set enable_seqscan=off;
SET VARIABLE
snet=# explain analyze select * from t2002_06 WHERE station = 'SAMI4';
NOTICE: QUERY PLAN:

Index Scan using t2002_06_station_idx on t2002_06 (cost=0.00..132773.85
rows=35169 width=47) (actual time=74.86..299.53 rows=38146 loops=1)
Total runtime: 313.42 msec

EXPLAIN

Any thoughts? I am sorry to be causing all this trouble. I just want my
queries to voom-voom!! Interestingly enough, I see that the SEQ SCAN is
now estimated at 1730.63, when I first posted to this list, it was 3900.00
or so. Errrr

Thanks,
Daryl

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Christopher Kings-Lynne 2002-07-24 02:09:17 Re: Queries not using Index
Previous Message Christopher Kings-Lynne 2002-07-24 01:47:18 Re: Queries not using Index