Re: "Group By " index usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



sdfasdfas sdfasdfs <descuarinjado@xxxxxxxx> 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


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux