Re: Performance penalty when using WITH - Mailing list pgsql-performance

From Robert Klemme
Subject Re: Performance penalty when using WITH
Date
Msg-id CAM9pMnMx6aG-XQFvQSUTa-jWBbeEC23nS6iH7_qGiGpymc_xmA@mail.gmail.com
Whole thread Raw
In response to Performance penalty when using WITH  (Li Jin <ljin@tripadvisor.com>)
List pgsql-performance
On Wed, Aug 3, 2011 at 3:27 PM, Li Jin <ljin@tripadvisor.com> wrote:
> Robert,
> I've built an index on this expression firstname || ' ' ||
> substring(lastname,1,1). I believe this is the best index for this
> particular query. Correct me if I am wrong.

Maybe, maybe not.  Difficult to tell from a distance.  I would have an
index on (firstname, lastname).  You could try that and look at the
plan for the other query.  That's the only ultimate test which will
give you hard facts.

Kind regards

robert


--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

pgsql-performance by date:

Previous
From: Andy Colson
Date:
Subject: Re: Postgres performance on Linux and Windows
Next
From: Dusan Misic
Date:
Subject: Re: Postgres performance on Linux and Windows