Re: difference in plan between 8.0 and 8.1? - Mailing list pgsql-performance

From Merlin Moncure
Subject Re: difference in plan between 8.0 and 8.1?
Date
Msg-id 6EE64EF3AB31D5448D0007DD34EEB3417DD1F3@Herge.rcsinc.local
Whole thread Raw
In response to difference in plan between 8.0 and 8.1?  (Alan Stange <stange@rentec.com>)
List pgsql-performance
> 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;

I had the same problem.  You probably already have seq scan turned off,
or the server would be using that.  You may have to turn bitmap off or
rework you query such that the server will use the index.  (between?).

Anyways, distinct is code word for 'bad performance' :).  Consider
laying out tables such that it not necessary, for example set up table
with RI link.  Then you can do this in zero time.

Good luck!

Merlin

pgsql-performance by date:

Previous
From: Ligesh
Date:
Subject: Sending a select to multiple servers.
Next
From: Tom Lane
Date:
Subject: Re: Limit + group + join