Re: PG won't use index on ORDER BY - Mailing list pgsql-sql

From Gregory Stark
Subject Re: PG won't use index on ORDER BY
Date
Msg-id 87abt0rsnc.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: PG won't use index on ORDER BY  (Andreas Joseph Krogh <andreak@officenet.no>)
List pgsql-sql
"Andreas Joseph Krogh" <andreak@officenet.no> writes:

> Ooops, just fugured that out. But - it still doesn't use the index if I remove 
> the "varchar_pattern_ops". I solved it by adding a function:

Hm, well it does for me, you would have to post your explain analyze to see
what's going on.

> Another question then: Why doesn't "varchar_pattern_ops" handle ordering? This 
> means I need 2 indexes on the columns I want to match with LIKE and ORDER BY. 
> Just doesn't seem right to need 2 "similar" indexes...

If you initd in the C locale you only need one index. In other locales the
collation order and the pattern order are different.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com



pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: PG won't use index on ORDER BY
Next
From: Lew
Date:
Subject: Re: Race condition in resetting a sequence