X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id A633C9DCA02 for ; Thu, 15 Dec 2005 15:29:27 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 18772-08 for ; Thu, 15 Dec 2005 15:29:27 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from linda-1.paradise.net.nz (bm-1a.paradise.net.nz [203.96.152.180]) by postgresql.org (Postfix) with ESMTP id 3718F9DCC31 for ; Thu, 15 Dec 2005 15:29:25 -0400 (AST) Received: from smtp-1.paradise.net.nz (tclsnelb1-src-1.paradise.net.nz [203.96.152.172]) by linda-1.paradise.net.nz (Paradise.net.nz) with ESMTP id <0IRK0003N0SUXU@linda-1.paradise.net.nz> for pgsql-performance@postgresql.org; Fri, 16 Dec 2005 08:29:22 +1300 (NZDT) Received: from [192.168.1.11] (218-101-28-62.dsl.clear.net.nz [218.101.28.62]) by smtp-1.paradise.net.nz (Postfix) with ESMTP id 04AD0D254E0; Fri, 16 Dec 2005 08:29:17 +1300 (NZDT) Date: Fri, 16 Dec 2005 08:29:17 +1300 From: Mark Kirkwood Subject: Re: Simple Join In-reply-to: <1134644526.14248.60.camel@firebolt> To: Mitch Skinner Cc: Kevin Brown , pgsql-performance@postgresql.org Message-id: <43A1C40D.8040006@paradise.net.nz> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7bit X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0.6 (X11/20051106) References: <200512141603.52583.blargity@gmail.com> <7484.1134600423@sss.pgh.pa.us> <1134629567.14248.27.camel@firebolt> <200512150148.16125.blargity@gmail.com> <1134644526.14248.60.camel@firebolt> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.148 required=5 tests=[AWL=0.148] X-Spam-Score: 0.148 X-Spam-Level: X-Archive-Number: 200512/356 X-Sequence-Number: 16177 Mitch Skinner wrote: > I saw that; what I'm suggesting is that that you try creating a 3-column > index on ordered_products using the paid, suspended_sub, and id columns. > In that order, I think, although you could also try the reverse. It may > or may not help, but it's worth a shot--the fact that all of those > columns are used together in the query suggests that you might do better > with a three-column index on those. > > With all three columns indexed individually, you're apparently not > getting the bitmap plan that Mark is hoping for. I imagine this has to > do with the lack of multi-column statistics in postgres, though you > could also try raising the statistics target on the columns of interest. > > Setting enable_seqscan to off, as others have suggested, is also a > worthwhile experiment, just to see what you get. > > Right on. Some of these "coerced" plans may perform much better. If so, we can look at tweaking your runtime config: e.g. effective_cache_size random_page_cost default_statistics_target to see if said plans can be chosen "naturally". cheers Mark