Re: faster search

From: Cosimo Streppone <cosimo(at)streppone(dot)it>
To: Postgresql Performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: faster search
Date: 2005-06-11 11:05:55
Message-ID: 42AAC593.4050406@streppone.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2005-06-11 16:49:32 Re: faster search
Previous Message Tobias Brox 2005-06-11 09:59:09 Re: Help with rewriting query