X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CF04052889 for ; Fri, 10 Jun 2005 17:12:22 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 32635-09 for ; Fri, 10 Jun 2005 20:12:14 +0000 (GMT) Received: from gp.word-to-the-wise.com (gp.word-to-the-wise.com [64.71.176.18]) by svr1.postgresql.org (Postfix) with ESMTP id 0AD7C52849 for ; Fri, 10 Jun 2005 17:12:13 -0300 (ADT) Received: by gp.word-to-the-wise.com (Postfix, from userid 500) id AD2A98FC07C; Fri, 10 Jun 2005 13:12:40 -0700 (PDT) Date: Fri, 10 Jun 2005 13:12:40 -0700 From: Steve Atkins To: pgsql-performance@postgresql.org Subject: Re: faster search Message-ID: <20050610201240.GA9822@gp.word-to-the-wise.com> References: <20050610132812.R94573@vbp2.vbp2.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050610132812.R94573@vbp2.vbp2.com> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.826 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_POST X-Spam-Level: X-Archive-Number: 200506/248 X-Sequence-Number: 12885 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