Re: Values list-of-targetlists patch for comments (was Re: - Mailing list pgsql-patches

From Alvaro Herrera
Subject Re: Values list-of-targetlists patch for comments (was Re:
Date
Msg-id 20060802185952.GD6019@alvh.no-ip.org
Whole thread Raw
In response to Re: Values list-of-targetlists patch for comments (was Re:  (Joe Conway <mail@joeconway.com>)
List pgsql-patches
Joe Conway wrote:

> What if we built an array of A_Const nodes instead of a List? Maybe we
> could use something akin to appendStringInfo()/enlargeStringInfo() to
> build the array of nodes and enlarge it in chunks.

In inval.c you find this:

/*
 * To minimize palloc traffic, we keep pending requests in successively-
 * larger chunks (a slightly more sophisticated version of an expansible
 * array).  All request types can be stored as SharedInvalidationMessage
 * records.  The ordering of requests within a list is never significant.
 */
typedef struct InvalidationChunk
{
    struct InvalidationChunk *next;     /* list link */
    int         nitems;         /* # items currently stored in chunk */
    int         maxitems;       /* size of allocated array in this chunk */
    SharedInvalidationMessage msgs[1];  /* VARIABLE LENGTH ARRAY */
} InvalidationChunk;            /* VARIABLE LENGTH STRUCTURE */

Which might give you an idea ...

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

pgsql-patches by date:

Previous
From: Joe Conway
Date:
Subject: Re: Values list-of-targetlists patch for comments (was Re:
Next
From: Tom Lane
Date:
Subject: Re: Values list-of-targetlists patch for comments (was Re: