Re: Benchmarking partitioning triggers and rules - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Benchmarking partitioning triggers and rules
Date
Msg-id 5524A9D2.8000302@aklaver.com
Whole thread Raw
In response to Re: Benchmarking partitioning triggers and rules  (Tim Uckun <timuckun@gmail.com>)
Responses Re: Benchmarking partitioning triggers and rules  (Tim Uckun <timuckun@gmail.com>)
List pgsql-general
On 04/07/2015 07:49 PM, Tim Uckun wrote:
> I understand that there is overhead involved in parsing the strings and
> such.  The amount of overhead was surprising to me but that's another
> matter.  What I am really puzzled about is the difference between the
> statements
>
> EXECUTE  'INSERT INTO ' ||  quote_ident(partition_name) ||  ' SELECT
> ($1).*' USING NEW ;
>
> and
>
>    EXECUTE  'INSERT INTO ' ||  quote_ident(partition_name) ||  ' VALUES
> (($1).*)' USING NEW ;


Offhand I would say because in the first case you are doing a SELECT and
in the second you are just doing a substitution.

>
> They both do string interpolation but one is significantly faster than
> the other.   Is there a third and even faster way?
>
> I am using RDS so I can't really do stored procs in C.
>


--
Adrian Klaver
adrian.klaver@aklaver.com


pgsql-general by date:

Previous
From: Tim Uckun
Date:
Subject: Re: Benchmarking partitioning triggers and rules
Next
From: Jim Nasby
Date:
Subject: Re: Would like to know how analyze works technically