Re: Query performance discontinuity

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Mike Nielsen <miken(at)bigpond(dot)net(dot)au>
Cc: Rod Taylor <rbt(at)rbt(dot)ca>, Postgresql performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Query performance discontinuity
Date: 2002-11-13 21:45:34
Message-ID: 200211131345.34038.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


Mike,

> Yes, I'd run a VACUUM FULL ANALYZE -- I did it again just to make sure,
> and re-ran the query (similar result):
>
> pganalysis=> explain analyze select * from ps2 where tstart> '2000-1-1
> pganalysis'> 00:00:00' and time_stamp > '2000-1-1 00:00:00' order by
> pganalysis-> tstart,time_stamp limit 59628;
> NOTICE: QUERY PLAN:
>
> Limit (cost=160313.27..160313.27 rows=59628 width=179) (actual
> time=45405.47..46320.12 rows=59628 loops=1)
> -> Sort (cost=160313.27..160313.27 rows=327895 width=179) (actual
> time=45405.46..46248.31 rows=59629 loops=1)
> -> Seq Scan on ps2 (cost=0.00..13783.40 rows=327895 width=179)
> (actual time=13.52..17111.66 rows=327960 loops=1)
> Total runtime: 46894.21 msec
>
> EXPLAIN
>
> Unfortunately, I have not yet had time to experiment with twiddling the
> query optimizer parameters or memory -- my apologies for this, but,
> well, a guy's gotta eat...

Well, I''ll just concur with what others have said: for some reason, the
parser is slightly underestimateing the cost of a seq scan, and dramatically
overestimating the cost of an index scan, for this query.

Other than tweaking to parser calculation values, I'd suggest dropping and
re-building the index just for thouroughness.

--
-Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Shridhar Daithankar 2002-11-14 04:05:21 Re: Upgrade to dual processor machine?
Previous Message Josh Berkus 2002-11-13 17:21:50 Re: Upgrade to dual processor machine?