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 4542E52871 for ; Sat, 11 Jun 2005 08:12:05 -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 32395-10 for ; Sat, 11 Jun 2005 11:11:52 +0000 (GMT) Received: from smtp2.libero.it (smtp2.libero.it [193.70.192.52]) by svr1.postgresql.org (Postfix) with ESMTP id C6C4A5292C for ; Sat, 11 Jun 2005 08:11:38 -0300 (ADT) Received: from localhost (172.16.1.83) by smtp2.libero.it (7.0.027-DD01) id 41BDB663027DB704 for pgsql-performance@postgresql.org; Sat, 11 Jun 2005 13:11:58 +0200 Received: from [151.25.110.175] (151.25.110.175) by smtp20.libero.it (7.0.027-DD01) (authenticated as tdezotti@inwind.it) id 41D02BD30709F452 for pgsql-performance@postgresql.org; Sat, 11 Jun 2005 13:11:38 +0200 Message-ID: <42AAC593.4050406@streppone.it> Date: Sat, 11 Jun 2005 13:05:55 +0200 From: Cosimo Streppone User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Postgresql Performance list Subject: Re: faster search References: <20050610132812.R94573@vbp2.vbp2.com> <20050610201240.GA9822@gp.word-to-the-wise.com> In-Reply-To: <20050610201240.GA9822@gp.word-to-the-wise.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at libero.it serv4 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.04 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/258 X-Sequence-Number: 12895 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