Planned changes in backend memory management - Mailing list pgsql-hackers

From Tom Lane
Subject Planned changes in backend memory management
Date
Msg-id 23737.1051730040@sss.pgh.pa.us
Whole thread Raw
List pgsql-hackers
I've committed some updates in the memory management README file to
describe what I'm about to do to the backend's memory management
conventions, in support of the new FE/BE protocol's extended-query
features.  You can read about it at 
http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/backend/utils/mmgr/README

Briefly:

* TransactionCommandContext is going away --- it doesn't seem to have
any function once we insist that all execution is going to happen inside
portals.

* The former meaning of QueryContext is now assigned to MessageContext;
this is a context that holds the current input message from the
frontend, and is reset before accepting each new input message.

* The QueryContext global variable still exists, but no longer denotes a
single memory context.  It will point to the memory context holding the
parse and plan trees for the currently-executing query --- this could be
either MessageContext or the private memory context of a
prepared-statement object.  There will be only limited need to use this
variable, I expect.  (PreventTransactionChain might be the only place,
in fact.)

* Analogous to QueryContext, there will be a global variable
PortalContext that points at the private context of the currently
executing portal.  This can substitute for TransactionCommandContext for
places that need to allocate memory that will live for the duration of
the current command.

Comments?
        regards, tom lane



pgsql-hackers by date:

Previous
From: Patrick Macdonald
Date:
Subject: PITR: Proposed modifications to JR's design
Next
From: Daniele Orlandi
Date:
Subject: Attribute must be GROUPed.... ?