Re: Increase performance of a UNION query that thakes

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Bruno BAGUETTE <pgsql-ml(at)baguette(dot)net>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Increase performance of a UNION query that thakes
Date: 2004-02-06 15:52:24
Message-ID: 20040206074755.M86604@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


On Fri, 6 Feb 2004, Bruno BAGUETTE wrote:

> I was thinking that a index on lower(substr(l_name, 1, 1)) and another
> index on lower(substr(org_name, 1, 1)) should gives better performances.
> When I've to create theses two indexes, it seems like this is not
> allowed :
>
> levure=> CREATE INDEX firstchar_lastname_idx ON
> people(lower(substr(l_name, 1, 1)));
> ERROR: parser: parse error at or near "(" at character 59

In 7.4, I believe you would say
on people((lower(substr(l_name,1,1))))
but I'm not sure that index would really help in practice.

> Do you have another idea to get better performances ?

In addition to what Tom said, the row estimates look suspiciously default.
You mention vacuuming, but do you ever analyze the tables?

Also, what do you have sort_mem set to?

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Bruno BAGUETTE 2004-02-06 16:34:48 RE : Increase performance of a UNION query that thakes 655.07 msec to be runned ?
Previous Message Tom Lane 2004-02-06 15:28:24 Re: Increase performance of a UNION query that thakes 655.07 msec to be runned ?