Re: "Group By " index usage

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: "Group By " index usage
Дата
Msg-id 10877.1101318923@sss.pgh.pa.us
обсуждение исходный текст
Ответ на "Group By " index usage  (sdfasdfas sdfasdfs <descuarinjado@yahoo.es>)
Список pgsql-performance
sdfasdfas sdfasdfs <descuarinjado@yahoo.es> writes:
> I have a table with this index:
>  create index ARTISTS_NAME on ARTISTS (
>  lower(AR_NAME)
>  );

> Te index is over a colum with this definition:

>  AR_NAME              VARCHAR(256)         null,

> I want to optimize this query:

>  select * from artists where lower(ar_name) like
> lower('a%') order by lower(ar_name) limit 20;

> I think the planner should use the index i have.

Update to 7.4, or declare the column as TEXT instead of VARCHAR.
Older versions aren't very bright about situations involving
implicit coercions.

            regards, tom lane

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

Предыдущее
От: sdfasdfas sdfasdfs
Дата:
Сообщение: "Group By " index usage
Следующее
От: "gnari"
Дата:
Сообщение: Re: FW: Index usage