pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gregory Stark <stark@enterprisedb.com>
To: Andreas Joseph Krogh <andreak@officenet.no>
Cc: pgsql-sql@postgresql.org
Subject: Re: PG won't use index on ORDER BY <expression>
Date: Thu, 09 Aug 2007 21:00:54 +0100
Message-ID: <87fy2s1nrd.fsf@oxford.xeocode.com> (raw)
In-Reply-To: <200708092018.44111.andreak@officenet.no>
References: <200708092018.44111.andreak@officenet.no>

"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




view thread (9+ messages)  latest in thread

Message-ID: <87fy2s1nrd.fsf@oxford.xeocode.com>
Permalink:  ../87fy2s1nrd.fsf@oxford.xeocode.com/
Also on:    postgresql.org/message-id/87fy2s1nrd.fsf@oxford.xeocode.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: stark@enterprisedb.com, andreak@officenet.no
  Subject: Re: PG won't use index on ORDER BY <expression>
  In-Reply-To: <87fy2s1nrd.fsf@oxford.xeocode.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox