Re: Rules slower than Dynamic SQL ? - Mailing list pgsql-general

From Decibel!
Subject Re: Rules slower than Dynamic SQL ?
Date
Msg-id 02A3553D-DF79-4681-BE6F-EF5B3C3FED6E@decibel.org
Whole thread Raw
In response to Re: Rules slower than Dynamic SQL ?  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-general
On Nov 26, 2007, at 6:09 PM, Simon Riggs wrote:
> On Mon, 2007-11-26 at 16:01 -0800, Alex Vinogradovs wrote:
>> I've got a data warehouse with pretty high rate of insert into
>> partitioned tables. What I've noticed, is that rule-based
>> partitioning
>> seems to be somewhat slower than insertions made directly into
>> partitions through execution of dynamic SQL.
>>
>> Is it really true ?
>
> Depends how complex your rules are, but I think yes is the short
> answer.

My understanding is that each rule has to re-evaluate the query
that's being run. That's going to add some overhead to a simple
INSERT INTO table VALUES ... but if you think that's bad, try it with
an expensive INSERT INTO table SELECT statement!
--
Decibel!, aka Jim C. Nasby, Database Architect  decibel@decibel.org
Give your computer some brain candy! www.distributed.net Team #1828



Attachment

pgsql-general by date:

Previous
From: Decibel!
Date:
Subject: Re: Calculation for Max_FSM_pages : Any rules of thumb?
Next
From: Gregory Stark
Date:
Subject: Re: Replication Monitoring