Re: [PATCHES] Partition: use triggers instead of rules

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Paesold <mpaesold(at)gmx(dot)at>, NikhilS <nikkhils(at)gmail(dot)com>, David Fetter <david(at)fetter(dot)org>, "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>, PostgreSQL Docs <pgsql-docs(at)postgresql(dot)org>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [PATCHES] Partition: use triggers instead of rules
Date: 2007-11-29 16:32:18
Message-ID: 474EE992.2050209@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-patches

Tom Lane wrote:
> "Joshua D. Drake" <jd(at)commandprompt(dot)com> writes:
>> Rules are extremely slow in comparisons and not anywhere near as
>> flexible. As I said up post yesterday... they work well in the basic
>> partitioning configuration but anything else they are extremely deficient.
>
> I think that the above claim is exceedingly narrow-minded.

We are talking about partitioning. It is supposed to be narrow-minded.

> A trigger
> will probably beat a rule for inserts/updates involving a small number
> of rows.

Which is exactly what partitioning is doing.

For large numbers of rows, like an INSERT/SELECT from another
> large table, the rule is likely to win, because its overhead is paid
> once per query not once per row. Also, if you implement the trigger
> with an EXECUTE (forcing a planning cycle) intead of hard-coded
> commands, the speed advantage becomes even more dubious.

Not for partitioning. Although I agree with your sentiments for normal
operation.

Sincerely,

Joshua D. Drake

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Bruce Momjian 2007-11-29 16:42:18 Re: [PATCHES] Partition: use triggers instead of rules
Previous Message Tom Lane 2007-11-29 16:17:25 Re: [PATCHES] Partition: use triggers instead of rules

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2007-11-29 16:42:18 Re: [PATCHES] Partition: use triggers instead of rules
Previous Message Tom Lane 2007-11-29 16:17:25 Re: [PATCHES] Partition: use triggers instead of rules