X-Original-To: pgsql-hackers-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 746029FBE5D for ; Sat, 26 Aug 2006 00:35:50 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 87326-04 for ; Sat, 26 Aug 2006 03:35:42 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from momjian.us (momjian.us [70.90.9.53]) by postgresql.org (Postfix) with ESMTP id 626019FBE5A for ; Sat, 26 Aug 2006 00:35:39 -0300 (ADT) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id k7Q3ZeJ04955; Fri, 25 Aug 2006 23:35:40 -0400 (EDT) From: Bruce Momjian Message-Id: <200608260335.k7Q3ZeJ04955@momjian.us> Subject: Re: VALUES clause memory optimization In-Reply-To: <44D2CCA4.8040507@joeconway.com> To: Joe Conway Date: Fri, 25 Aug 2006 23:35:40 -0400 (EDT) CC: Tom Lane , "Hackers (PostgreSQL)" X-Mailer: ELM [version 2.4ME+ PL123] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200608/1709 X-Sequence-Number: 89202 Has this been addressed? --------------------------------------------------------------------------- Joe Conway wrote: > Tom Lane wrote: > > 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. > > What about for the specific case of an InsertStmt? It seems that we > could at least get away with freeing the raw-expression list in that case. > > In terms of freeing an entire arbitrary node, could we create a > backend/nodes/freefuncs.c file that does a recursive freeObject() > similar to the way copyObject() does in backend/nodes/copyfuncs.c? > > > My advice is to get that low-hanging fruit > > in transformInsertRow and leave the other ideas for 8.3. > > OK. This should be safe also, correct? > > Thanks, > > Joe > > 8<---------------------------------------- > diff -c -r1.341 analyze.c > *** src/backend/parser/analyze.c 2 Aug 2006 01:59:46 -0000 1.341 > --- src/backend/parser/analyze.c 2 Aug 2006 05:13:20 -0000 > *************** > *** 2191,2196 **** > --- 2196,2202 ---- > for (i = 0; i < sublist_length; i++) > { > coltypes[i] = select_common_type(coltype_lists[i], "VALUES"); > + list_free(coltype_lists[i]); > } > > newExprsLists = NIL; > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faq -- Bruce Momjian bruce@momjian.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. +