From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Bruno BAGUETTE <pgsql-ml@baguette.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: Increase performance of a UNION query that thakes
Date: Fri, 6 Feb 2004 07:52:24 -0800 (PST)
Message-ID: <20040206074755.M86604@megazone.bigpanda.com> (raw)
In-Reply-To: <!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAATBuXKOMvlkWzD3KJN6FWLMKAAAAQAAAAJOHsHo2Nik+nfSVIsv82jwEAAAAA@baguette.net>
References: <!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAATBuXKOMvlkWzD3KJN6FWLMKAAAAQAAAAJOHsHo2Nik+nfSVIsv82jwEAAAAA@baguette.net>
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?
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-performance@postgresql.org
Cc: sszabo@megazone.bigpanda.com, pgsql-ml@baguette.net
Subject: Re: Increase performance of a UNION query that thakes
In-Reply-To: <20040206074755.M86604@megazone.bigpanda.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