From: Alan Stange <stange@rentec.com>
To: pgsql-performance@postgresql.org
Subject: difference in plan between 8.0 and 8.1?
Date: Fri, 26 Aug 2005 10:45:07 -0400
Message-ID: <430F2AF3.1080704@rentec.com> (raw)
Hello all,
I was hoping someone could explain the plan for a statement.
We have a table with a column of longs being used as an index. The
query plan in 8.0 was like this:
# explain select distinct timeseriesid from tbltimeseries where
timeseriesid > 0 order by timeseriesid;
SET
QUERY PLAN
-------------------------------------------------------------------------------------------------------
Unique (cost=0.00..15065908.60 rows=10854026 width=8)
-> Index Scan using idx_timeseris on tbltimeseries
(cost=0.00..15038773.53 rows=10854026 width=8)
Index Cond: (timeseriesid > 0)
(3 rows)
In 8.1, (using the same database after a dump+restore+vacuum+analyze) I
get the following:
# explain select distinct timeseriesid from tbltimeseries where
timeseriesid > 0 order by timeseriesid;
QUERY PLAN
---------------------------------------------------------------------------------------------------
Unique (cost=2717137.08..2771407.21 rows=10854026 width=8)
-> Sort (cost=2717137.08..2744272.14 rows=10854026 width=8)
Sort Key: timeseriesid
-> Bitmap Heap Scan on tbltimeseries
(cost=48714.09..1331000.42 rows=10854026 width=8)
Recheck Cond: (timeseriesid > 0)
-> Bitmap Index Scan on idx_timeseris
(cost=0.00..48714.09 rows=10854026 width=0)
Index Cond: (timeseriesid > 0)
(7 rows)
I'm hoping someone can explain the new query plan (as I'm not sure I
understand what it is doing).
Thanks!
-- Alan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: stange@rentec.com
Subject: Re: difference in plan between 8.0 and 8.1?
In-Reply-To: <430F2AF3.1080704@rentec.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox