pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Kirkwood <markir@paradise.net.nz>
To: Mitch Skinner <lists@arctur.us>
Cc: Kevin Brown <blargity@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Simple Join
Date: Fri, 16 Dec 2005 08:29:17 +1300
Message-ID: <43A1C40D.8040006@paradise.net.nz> (raw)
In-Reply-To: <1134644526.14248.60.camel@firebolt>
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>

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



view thread (19+ messages)  latest in thread

Message-ID: <43A1C40D.8040006@paradise.net.nz>
Permalink:  ../43A1C40D.8040006@paradise.net.nz/
Also on:    postgresql.org/message-id/43A1C40D.8040006@paradise.net.nz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: markir@paradise.net.nz, lists@arctur.us, blargity@gmail.com
  Subject: Re: Simple Join
  In-Reply-To: <43A1C40D.8040006@paradise.net.nz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox