Re: faster search

From: Steve Atkins <steve(at)blighty(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: faster search
Date: 2005-06-10 20:12:40
Message-ID: 20050610201240.GA9822@gp.word-to-the-wise.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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?

Because you need to extract a huge number of rows via a seqscan, sort
them and then throw them away, I think.

> explain analyze select * from test where productlistid=3 and typeid=9
> order by partnumber limit 15;

Create an index on (productlistid, typeid, partnumber) then

select * from test where productlistid=3 and typeid=9
order by productlistid, typeid, partnumber LIMIT 15;

?

Cheers,
Steve

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Havasvölgyi Ottó 2005-06-10 21:12:56 need suggestion for server sizing
Previous Message Kevin Grittner 2005-06-10 19:49:57 Re: Help with rewriting query