Re: Need help in setting optimal configuration for a huge

Поиск
Список
Период
Сортировка
От Tomasz Rybak
Тема Re: Need help in setting optimal configuration for a huge
Дата
Msg-id 1130087877.6708.16.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Re: Need help in setting optimal configuration for a huge  ("Craig A. James" <cjames@modgraph-usa.com>)
Список pgsql-performance
Dnia 23-10-2005, nie o godzinie 09:31 -0700, Craig A. James napisał(a):
<cut>
> MIN() and MAX() -- These are surprisingly slow, because they seem to do a full table scan EVEN ON AN INDEXED COLUMN!
In 8.1 this is no true, see the changelog.

> I don't understand why, but happily there is an effective substitute:
>
>    select mycolumn from mytable order by mycolumn limit 1;  -- same as MIN()
>
>    select mycolumn from mytable order by mycolumn desc limit 1;  -- same as MAX()

In 8.1 these queries are equivalent:

select mycolumn from mytable order by mycolumn limit 1;
select min(mycolumn) from mytable;

--
Tomasz Rybak <bogomips@post.pl>


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

Предыдущее
От: "Steinar H. Gunderson"
Дата:
Сообщение: Re: Need help in setting optimal configuration for a huge
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Need help in setting optimal configuration for a huge