X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 55CDF9F931D for ; Mon, 8 May 2006 17:50:10 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 95086-05 for ; Mon, 8 May 2006 17:50:05 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 85D9F9F931E for ; Mon, 8 May 2006 17:50:04 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k48Knwe8029685; Mon, 8 May 2006 16:49:58 -0400 (EDT) To: Jeffrey Tenny cc: "Jim C. Nasby" , pgsql-performance@postgresql.org Subject: Re: performance question (something to do w/ parameterized In-reply-to: <445FAB2A.9050401@comcast.net> References: <445F7FF8.6070707@comcast.net> <20060508173812.GW99570@pervasive.com> <445F9F6B.9040200@comcast.net> <29345.1147118920@sss.pgh.pa.us> <445FAB2A.9050401@comcast.net> Comments: In-reply-to Jeffrey Tenny message dated "Mon, 08 May 2006 16:33:46 -0400" Date: Mon, 08 May 2006 16:49:58 -0400 Message-ID: <29684.1147121398@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/156 X-Sequence-Number: 18943 Jeffrey Tenny writes: > I dropped the multicolumn index 'testindex2', and a new explain analyze > looks like this: > Sort (cost=35730.71..35768.28 rows=1503 width=16) (actual > time=962.555..964.467 rows=677 loops=1) > Sort Key: f, c > -> Seq Scan on x (cost=0.00..34937.60 rows=1503 width=16) (actual > time=5.449..956.594 rows=677 loops=1) > Filter: ((f = 1) OR (f = 2) OR (f = 3) ... > Turning on the server debugging again, I got roughly identical > query times with and without the two column index. That's good, actually, seeing that the planner thinks they're close to the same speed too. Now try "set enable_seqscan = off" to see if you can force the multi-index-scan plan to be chosen, and see how that does. regards, tom lane