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

From Tom Lane
Subject Re: Values list-of-targetlists patch for comments (was Re:
Date
Msg-id 19646.1154546306@sss.pgh.pa.us
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 <mail@joeconway.com> writes:
> 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.

For lists this short I'm not sure how much of a win it'd be.  It's
interesting though to think about doing something like that within the
List abstraction itself.  We did a "fastlist" hack once before and it
was a crock ... don't want to do that again.  But now that we've got a
distinction between List and ListCell you could imagine that a List
header has a small private array of ListCells ... tuning the size might
be tricky though.

Another thing we could consider is flattening the double-level list into
a single list ... probably be a pain notationally, but it'd save one
List header and one ListCell per VALUES sublist.  And it would offer
more traction for an array-inside-Lists optimization.

            regards, tom lane

pgsql-patches by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Values list-of-targetlists patch for comments (was Re:
Next
From: "Sergey E. Koposov"
Date:
Subject: SQL conformance, optional feature T621