Re: PG won't use index on ORDER BY <expression>

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Andreas Joseph Krogh" <andreak(at)officenet(dot)no>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: PG won't use index on ORDER BY <expression>
Date: 2007-08-09 20:00:54
Message-ID: 87fy2s1nrd.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Andreas Joseph Krogh" <andreak(at)officenet(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Andreas Joseph Krogh 2007-08-09 20:38:46 Re: PG won't use index on ORDER BY <expression>
Previous Message Andreas Joseph Krogh 2007-08-09 18:18:43 PG won't use index on ORDER BY <expression>