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 87fy2s1nrd.fsf@oxford.xeocode.com
Whole thread Raw
In response to PG won't use index on ORDER BY  (Andreas Joseph Krogh <andreak@officenet.no>)
Responses 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:

> I create an index:
> CREATE INDEX person_lowerfullname_idx ON 
> person((lower(COALESCE(firstname, '')) || lower(COALESCE(lastname, ''))) 
> varchar_pattern_ops);

Why are you declaring it using the varchar_pattern_ops?

The default operator set is the one you want for handling ordering. The
pattern_ops operator set is for handling things like x LIKE 'foo%'

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



pgsql-sql by date:

Previous
From: Andreas Joseph Krogh
Date:
Subject: PG won't use index on ORDER BY
Next
From: Andreas Joseph Krogh
Date:
Subject: Re: PG won't use index on ORDER BY