From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeff Janes <jeff.janes@gmail.com>
Cc: Patryk Sidzina <patryk.sidzina@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Why is PostgreSQL 9.2 slower than 9.1 in my tests?
Date: Tue, 11 Dec 2012 19:38:31 -0500
Message-ID: <2350.1355272711@sss.pgh.pa.us> (raw)
In-Reply-To: <CAMkU=1wnZ=ky+sEV40jtchqgYXuMWKq4f=c_bpJGsCtHUQc-gg@mail.gmail.com>
References: <CAD4+=qWnGU0qi+iq=EPh6EGPuUnSCYsGDTgKazizEvrGgjo0Sg@mail.gmail.com>
<CAMkU=1zcAGKqt36frn8zTytJvta82cM1LAVf2Z0iPfjHLra_Tg@mail.gmail.com>
<CAD4+=qXu14wW7qkgkCiGRaeQ9SSLXBGMra07RMLCm_4oJE51=A@mail.gmail.com>
<CAMkU=1wnZ=ky+sEV40jtchqgYXuMWKq4f=c_bpJGsCtHUQc-gg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
Jeff Janes <jeff.janes@gmail.com> writes:
> On Tue, Dec 11, 2012 at 2:50 AM, Patryk Sidzina
> <patryk.sidzina@gmail.com> wrote:
>> The differences come up when you change the "INSERT" to "EXECUTE 'INSERT'" (
>> and i checked this time on 3 machines, one of which was Windows):
>> FOR i IN 1..cnt LOOP
>> EXECUTE 'INSERT INTO test_table_md_speed(n) VALUES (' || i || ')';
>> END LOOP;
> The culprit is the commit below. I don't know exactly why this slows
> down your case. A preliminary oprofile analysis suggests that it most
> of the slowdown is that it calls AllocSetAlloc more often. I suspect
> that this slow-down will be considered acceptable trade-off for
> getting good parameterized plans.
I'm having a hard time getting excited about optimizing the above case:
the user can do far more to make it fast than we can, simply by not
using EXECUTE, which is utterly unnecessary in this example.
Having said that, though, it's not real clear to me why the plancache
changes would have affected the speed of EXECUTE at all --- the whole
point of that command is we don't cache a plan for the query.
regards, tom lane
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
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: tgl@sss.pgh.pa.us, jeff.janes@gmail.com, patryk.sidzina@gmail.com
Subject: Re: Why is PostgreSQL 9.2 slower than 9.1 in my tests?
In-Reply-To: <2350.1355272711@sss.pgh.pa.us>
* 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