Re: SELECT DISTINCT very slow

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: SELECT DISTINCT very slow
Дата
Msg-id 162867790907090856s347ede5bl8dfceec3ec9d933c@mail.gmail.com
обсуждение исходный текст
Ответ на SELECT DISTINCT very slow  (Ben Harper <rogojin@gmail.com>)
Список pgsql-general
Hello

when you use older pg than 8.3, please, use GROUP BY.

SELECT field FROM table GROUP BY field.

Regards
Pavel Stehule

2009/7/9 Ben Harper <rogojin@gmail.com>:
> Hi,
> Can anybody explain this:
>
> Records: 600,000
> Field Width: Approximately 20 UTF8 characters - type is VARCHAR(25)
> Field is Indexed.
>
> SELECT DISTINCT field FROM table;
>
> Takes about 6 seconds. There are 111 distinct items.
>
> On Sqlite, and another place where I have a B+Tree, this query is
> faster than my eye can measure.
>
> Is this a well known issue?
>
> Thanks,
> Ben
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: SELECT DISTINCT very slow
Следующее
От: Dan Armbrust
Дата:
Сообщение: Re: Checkpoint Tuning Question