Re: Why is sorting on two columns so slower than sorting on one column?

Поиск
Список
Период
Сортировка
От Marti Raudsepp
Тема Re: Why is sorting on two columns so slower than sorting on one column?
Дата
Msg-id AANLkTi=ceKpoPDcJGsE4WAkN4dzFqhOQ=zyuyo5eYL3O@mail.gmail.com
обсуждение исходный текст
Ответ на Why is sorting on two columns so slower than sorting on one column?  (Jie Li <jay23jack@gmail.com>)
Список pgsql-hackers
On Thu, Dec 23, 2010 at 09:33, Jie Li <jay23jack@gmail.com> wrote:
> While the first sorting takes
> about only 6 seconds, the second one takes over 30 seconds,  Is this too
> much than expected? Is there any possible optimization ?

If you're doing these queries often, you should:
CREATE INDEX ix_big_wf_age_id ON big_wf (age, id)

If that's still not fast enough, you can physically sort rows in the
table using the newly created index:
CLUSTER big_wf USING ix_big_wf_age_id;

Please post back your results. :)

Regards,
Marti


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jan Urbański
Дата:
Сообщение: pl/python custom datatype parsers
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: GiST insert algorithm rewrite