pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joshua D. Drake <jd@commandprompt.com>
To: Gregory Stark <stark@enterprisedb.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Michael Paesold <mpaesold@gmx.at>
Cc: NikhilS <nikkhils@gmail.com>
Cc: David Fetter <david@fetter.org>
Cc: Jonah H. Harris <jonah.harris@gmail.com>
Cc: PostgreSQL Docs <pgsql-docs@postgresql.org>
Cc: PostgreSQL Patches <pgsql-patches@postgresql.org>
Subject: Re: Partition: use triggers instead of rules
Date: Thu, 29 Nov 2007 09:13:59 -0800
Message-ID: <20071129091359.206fd8f2@commandprompt.com> (raw)
In-Reply-To: <87zlwxj7xu.fsf@oxford.xeocode.com>
References: <20071128202615.GG24146@fetter.org>
	<21686.1196283184@sss.pgh.pa.us>
	<36e682920711281858x9a37039sa104036bf025de41@mail.gmail.com>
	<20071129031702.GU24146@fetter.org>
	<2854.1196315753@sss.pgh.pa.us>
	<20071128224154.06f950c9@commandprompt.com>
	<d3c4af540711290705q35ea51cdkfaa94b0c07a1aecc@mail.gmail.com>
	<474EDAE2.3010705@gmx.at>
	<474EE25E.3080304@commandprompt.com>
	<14455.1196353045@sss.pgh.pa.us>
	<474EE992.2050209@commandprompt.com>
	<87zlwxj7xu.fsf@oxford.xeocode.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 29 Nov 2007 17:08:29 +0000
Gregory Stark <stark@enterprisedb.com> wrote:

> 
> "Joshua D. Drake" <jd@commandprompt.com> writes:
> 
> > Tom Lane wrote:
> >
> >>  A trigger will probably beat a rule for inserts/updates involving
> >> a small number of rows.
> >
> > Which is exactly what partitioning is doing.
> 
> Say what?

Heh, o.k. that was an ambiguous sentence. In a partitioned environment
you are likely not moving millions of rows around. Thus the "rule"
benefit is lost. You are instead performing many (sometimes
lots-o-many) inserts and updates that involve a small number of rows.

A trigger/function as Tom already pointed out is going to perform better
than a rule in that case. The benefit becomes even more pronounce the
more partitions you have.

Sincerely,

Joshua D. Drake


- -- 

      === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564   24x7/Emergency: +1.800.492.2240
PostgreSQL solutions since 1997  http://www.commandprompt.com/
			UNIQUE NOT NULL
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHTvNXATb/zqfZUUQRAqeJAJ9CoO6F4zYJwY4geAR1UsvVCYqagwCdFJm9
63GRksppATp7fK9qu2RYXD0=
=VuWy
-----END PGP SIGNATURE-----


view thread (38+ messages)  latest in thread

Message-ID: <20071129091359.206fd8f2@commandprompt.com>
Permalink:  ../20071129091359.206fd8f2@commandprompt.com/
Also on:    postgresql.org/message-id/20071129091359.206fd8f2@commandprompt.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-docs@postgresql.org
  Cc: jd@commandprompt.com, stark@enterprisedb.com, tgl@sss.pgh.pa.us, mpaesold@gmx.at, nikkhils@gmail.com, david@fetter.org, jonah.harris@gmail.com, pgsql-patches@postgresql.org
  Subject: Re: Partition: use triggers instead of rules
  In-Reply-To: <20071129091359.206fd8f2@commandprompt.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