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:32:00
Message-ID: 20080402183200.517817558E7@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.

Tags:
----
REL8_3_STABLE

Modified Files:
--------------
pgsql/src/backend/commands:
portalcmds.c (r1.69 -> r1.69.2.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/portalcmds.c?r1=1.69&r2=1.69.2.1)
prepare.c (r1.80 -> r1.80.2.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/prepare.c?r1=1.80&r2=1.80.2.1)
pgsql/src/backend/executor:
spi.c (r1.188 -> r1.188.2.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/spi.c?r1=1.188&r2=1.188.2.1)
pgsql/src/backend/tcop:
postgres.c (r1.542.2.1 -> r1.542.2.2)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/tcop/postgres.c?r1=1.542.2.1&r2=1.542.2.2)
pgsql/src/backend/utils/mmgr:
portalmem.c (r1.106 -> r1.106.2.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/mmgr/portalmem.c?r1=1.106&r2=1.106.2.1)

Browse pgsql-committers by date

  From Date Subject
Next Message User Rlucas 2008-04-02 22:49:34 aupg - aupg_src: added default id=1 entry for trust graph to trust all
Previous Message Tom Lane 2008-04-02 18:31:51 pgsql: Revert my bad decision of about a year ago to make