pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Brown <blargity@gmail.com>
To: Mark Kirkwood <markir@paradise.net.nz>
Cc: pgsql-performance@postgresql.org
Subject: Re: Simple Join
Date: Thu, 15 Dec 2005 01:46:06 -0600
Message-ID: <200512150146.06336.blargity@gmail.com> (raw)
In-Reply-To: <43A0BA70.8000802@paradise.net.nz>
References: <200512141603.52583.blargity@gmail.com>
	<200512141752.45866.blargity@gmail.com>
	<43A0BA70.8000802@paradise.net.nz>

On Wednesday 14 December 2005 18:36, you wrote:
> Well - that had no effect at all :-) You don't have and index on
> to_ship.ordered_product_id do you? - try adding one (ANALYZE again), and
> let use know what happens (you may want to play with SET
> enable_seqscan=off as well).

I _DO_ have an index on to_ship.ordered_product_id.  It's a btree.

> And also, if you are only ever interested in paid = true and
> suspended_sub = false, then you can recreate these indexes as partials -
> e.g:
>
> CREATE INDEX paid_index ON ordered_products (paid) WHERE paid = true;
> CREATE INDEX suspended_sub_index ON ordered_products (suspended_sub)
> WHERE suspended_sub = false;

They're currently defined as individuals and I'm depending on the bitmap 
indexing.

> > So what's the best way to performance wiggle this info out of the db? 
> > The list of values is only about 30 tuples long out of this query, so I
> > was figuring I could trigger on insert to to_ship to place the value into
> > another table if it didn't already exist.  I'd rather the writing be slow
> > than the reading.
>
> Yeah - all sort of horrible denormalizations are possible :-), hopefully
> we can get the original query to work ok, and avoid the need to add code
> or triggers to you app.

That'd be great.



view thread (19+ messages)  latest in thread

Message-ID: <200512150146.06336.blargity@gmail.com>
Permalink:  ../200512150146.06336.blargity@gmail.com/
Also on:    postgresql.org/message-id/200512150146.06336.blargity@gmail.com

 · 

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: blargity@gmail.com, markir@paradise.net.nz
  Subject: Re: Simple Join
  In-Reply-To: <200512150146.06336.blargity@gmail.com>

* 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