Re: min/max performance inequality.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: min/max performance inequality.
Дата
Msg-id 1018.1420673751@sss.pgh.pa.us
обсуждение исходный текст
Ответ на min/max performance inequality.  (Pawel Veselov <pawel.veselov@gmail.com>)
Список pgsql-general
Pawel Veselov <pawel.veselov@gmail.com> writes:
> I was wondering how come there is such a drastic difference between finding
> max and min. Seems like "index scan backwards" is really bad...

It's probably an artifact of your data distribution, ie, the "blockid =
4814" condition is skipping lots of rows at one end of the index but few
or none at the other.

If you're concerned about the performance of this type of query, an index
on (blockid, rowdate) would work a lot better than the ones you've
provided.

            regards, tom lane


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

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: min/max performance inequality.
Следующее
От: Pawel Veselov
Дата:
Сообщение: Re: min/max performance inequality.