pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Steven Flatt <steven.flatt@gmail.com>
To: Jim C. Nasby <jim@nasby.net>
Cc: Colin Taylor <colin.taylor@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: table partioning performance
Date: Wed, 10 Jan 2007 16:39:06 -0500
Message-ID: <357fa7590701101339m53a4b12foc805ff0060be609b@mail.gmail.com> (raw)
In-Reply-To: <20070110202442.GV12217@nasby.net>
References: <84d3067d0701062037k3229c9ddjbde73b1fd79ee209@mail.gmail.com>
	<357fa7590701081202p726c049ej61390dd1816d1369@mail.gmail.com>
	<20070110202442.GV12217@nasby.net>

On 1/10/07, Jim C. Nasby <jim@nasby.net> wrote:
>
> Except for the simplest partitioning cases, you'll be much better off
> using a trigger on the parent table to direct inserts/updates/deletes to
> the children. As a bonus, using a trigger makes it a lot more realistic
> to deal with an update moving data between partitions.


In our application, data is never moved between partitions.

The problem I found with triggers is the non-robustness of the PLpgSQL
record data type.  For example, in an "on insert" trigger, I can't determine
the fields of the NEW record unless I hard code the column names into the
trigger.  This makes it hard to write a generic trigger, which I can use for
all our partitioned tables.  It would have been somewhat of a pain to write
a separate trigger for each of our partitioned tables.

For that and other reasons, we moved some of the insert logic up to the
application level in our product.

Steve

view thread (12+ messages)  latest in thread

Message-ID: <357fa7590701101339m53a4b12foc805ff0060be609b@mail.gmail.com>
Permalink:  ../357fa7590701101339m53a4b12foc805ff0060be609b@mail.gmail.com/
Also on:    postgresql.org/message-id/357fa7590701101339m53a4b12foc805ff0060be609b@mail.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: steven.flatt@gmail.com, jim@nasby.net, colin.taylor@gmail.com
  Subject: Re: table partioning performance
  In-Reply-To: <357fa7590701101339m53a4b12foc805ff0060be609b@mail.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