Re: [HACKERS] Group by, count, order by and limit

Поиск
Список
Период
Сортировка
От Shridhar Daithankar
Тема Re: [HACKERS] Group by, count, order by and limit
Дата
Msg-id 200302181111.38250.shridhar_daithankar@persistent.co.in
обсуждение исходный текст
Список pgsql-general
On Tuesday 18 Feb 2003 9:56 am, you wrote:
> My 3rd attempt to post ...
>
> Consider this query on a large table with lots of different IDs:
>
>     SELECT id FROM my_table GROUP BY id ORDER BY count(id) LIMIT 10;
>
> It has an index on id.  Obviously, the index helps to evaluate count(id)
> for a given value of id, but count()s for all the `id's should be
> evaluated, so sort() will take most of the time.

First, what does explain analyze say

Second, wild shot, how much difference does it make with different sort_mem
settings?

 Shridhar

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

Предыдущее
От: "Shridhar Daithankar"
Дата:
Сообщение: Re: Table Partitioning in Postgres:
Следующее
От: Christopher Murtagh
Дата:
Сообщение: Re: pg_dump --> restore loses constraints/triggers?