Re: difference in plan between 8.0 and 8.1?

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: difference in plan between 8.0 and 8.1?
Дата
Msg-id 6EE64EF3AB31D5448D0007DD34EEB3417DD1F3@Herge.rcsinc.local
обсуждение исходный текст
Ответ на difference in plan between 8.0 and 8.1?  (Alan Stange <stange@rentec.com>)
Список 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 по дате отправления:

Предыдущее
От: Ligesh
Дата:
Сообщение: Sending a select to multiple servers.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Limit + group + join