pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Joe Conway <mail@joeconway.com>
Cc: Hackers (PostgreSQL) <pgsql-hackers@postgresql.org>
Subject: Re: VALUES clause memory optimization (was: Values list-of-targetlists patch...)
Date: Thu, 03 Aug 2006 08:48:57 -0400
Message-ID: <2922.1154609337@sss.pgh.pa.us> (raw)
In-Reply-To: <44D140DF.5080209@joeconway.com>
References: <44B69778.5050104@dunslane.net>
	<50461.84.63.113.55.1152832991.squirrel@pezone.net>
	<ECCAAC0A3182895D3D12B0E8@[172.26.14.247]>
	<44B7ADFC.90205@dunslane.net>
	<44D03D9F.80203@joeconway.com>
	<15263.1154526181@sss.pgh.pa.us>
	<44D0AF87.2030304@joeconway.com>
	<16892.1154528708@sss.pgh.pa.us>
	<44D0B9C1.2020608@joeconway.com>
	<17704.1154534183@sss.pgh.pa.us>
	<44D140DF.5080209@joeconway.com>

Joe Conway <mail@joeconway.com> writes:
> In transformExpr the comment implies that it should be safe to reapply
> to an already transformed expression. What if we free the raw_parser
> expression list/cells/nodes and replace it with the as-transformed one?

How are you going to do the "replace" bit?  The entire problem is that
you don't know where are all the down-links leading to the subexpression
you are currently working on.

The reason we could safely list_free inside transformInsertRow is that
we know all its callers have just built the passed-in list and so there
are no other pointers to it.  That doesn't apply in the general case of
grammar output.

I think in the long run we probably ought to fix things so that the
grammar never outputs any multiply-linked trees; that little shortcut
has been a continuing source of grief for many reasons.  I can't see
doing that for 8.2 though.  My advice is to get that low-hanging fruit
in transformInsertRow and leave the other ideas for 8.3.

			regards, tom lane



view thread (2+ messages)

Message-ID: <2922.1154609337@sss.pgh.pa.us>
Permalink:  ../2922.1154609337@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2922.1154609337@sss.pgh.pa.us

 · 

reply

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-docs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, mail@joeconway.com, pgsql-hackers@postgresql.org
  Subject: Re: VALUES clause memory optimization (was: Values list-of-targetlists patch...)
  In-Reply-To: <2922.1154609337@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