pgsql: Revert my bad decision of about a year ago to make

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Revert my bad decision of about a year ago to make
Date: 2008-04-02 18:31:51
Message-ID: 20080402183151.0527B7558E7@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Revert my bad decision of about a year ago to make PortalDefineQuery
responsible for copying the query string into the new Portal. Such copying
is unnecessary in the common code path through exec_simple_query, and in
this case it can be enormously expensive because the string might contain
a large number of individual commands; we were copying the entire, long
string for each command, resulting in O(N^2) behavior for N commands.
(This is the cause of bug #4079.) A second problem with it is that
PortalDefineQuery really can't risk error, because if it elog's before
having set up the Portal, we will leak the plancache refcount that the
caller is trying to hand off to the portal. So go back to the design in
which the caller is responsible for making sure everything is copied into
the portal if necessary.

Modified Files:
--------------
pgsql/src/backend/commands:
portalcmds.c (r1.72 -> r1.73)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/portalcmds.c?r1=1.72&r2=1.73)
prepare.c (r1.84 -> r1.85)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/prepare.c?r1=1.84&r2=1.85)
pgsql/src/backend/executor:
spi.c (r1.192 -> r1.193)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/spi.c?r1=1.192&r2=1.193)
pgsql/src/backend/tcop:
postgres.c (r1.547 -> r1.548)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/tcop/postgres.c?r1=1.547&r2=1.548)
pgsql/src/backend/utils/mmgr:
portalmem.c (r1.108 -> r1.109)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/mmgr/portalmem.c?r1=1.108&r2=1.109)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2008-04-02 18:32:00 pgsql: Revert my bad decision of about a year ago to make
Previous Message User Fxjr 2008-04-02 15:16:24 npgsql - Npgsql2: [#1010312] Code cleanup.