From: Cosimo Streppone <cosimo@streppone.it>
To: Postgresql Performance list <pgsql-performance@postgresql.org>
Subject: Re: faster search
Date: Sat, 11 Jun 2005 13:05:55 +0200
Message-ID: <42AAC593.4050406@streppone.it> (raw)
In-Reply-To: <20050610201240.GA9822@gp.word-to-the-wise.com>
References: <20050610132812.R94573@vbp2.vbp2.com>
<20050610201240.GA9822@gp.word-to-the-wise.com>
Steve Atkins wrote:
> On Fri, Jun 10, 2005 at 01:45:05PM -0400, Clark Slater wrote:
>
>>Hi-
>>
>>Would someone please enlighten me as
>>to why I'm not seeing a faster execution
>>time on the simple scenario below?
>
> [...]
>
> Create an index on (productlistid, typeid, partnumber) then
>
> select * from test where productlistid=3 and typeid=9
> order by productlistid, typeid, partnumber LIMIT 15;
>
Clark, try also adding (just for testing) partnumber to your
where clause, like this:
select * from test where productlistid=3 and typeid=9
and partnumber='foo' order by productlistid,
typeid, partnumber;
and check output of explain analyze.
I had experiences of planner "bad" use of indexes when attribute
types were integer and cardinality was low (a single attribute
value, like "typeid=9" selects one or few rows).
However, this was on 7.1.3, and probably is not relevant to your case.
--
Cosimo
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: cosimo@streppone.it
Subject: Re: faster search
In-Reply-To: <42AAC593.4050406@streppone.it>
* 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