Re: faster search - Mailing list pgsql-performance

From Steve Atkins
Subject Re: faster search
Date
Msg-id 20050610201240.GA9822@gp.word-to-the-wise.com
Whole thread Raw
In response to faster search  (Clark Slater <list@slatech.com>)
Responses Re: faster search
List 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

pgsql-performance by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: Help with rewriting query
Next
From: Clark Slater
Date:
Subject: Re: faster search