Re: tuplestore_putvalues() - Mailing list pgsql-patches

From Tom Lane
Subject Re: tuplestore_putvalues()
Date
Msg-id 23186.1204266760@sss.pgh.pa.us
Whole thread Raw
In response to tuplestore_putvalues()  (Neil Conway <neilc@samurai.com>)
List pgsql-patches
Neil Conway <neilc@samurai.com> writes:
> Attached is a patch that allows an array of Datums + nulls to be
> inserted into a tuplestore without first creating a HeapTuple, per
> recent suggestion on -hackers. This avoids making an unnecessary copy.

A small thought here: we were jousting recently over a point that came
down to whether or not tuplestore kept track of the tupdesc for the
tuples it was storing.  I can hardly imagine a use-case for a tuplestore
in which the tuples don't all have the same tupdesc.  I think I dropped
tupdesc from tuplestore's original API on the grounds that it wasn't
doing anything much with the tupdesc.  But now this patch adds back a
tuplestore API call that needs the tupdesc.  Would it be saner to supply
the tupdesc to tuplestore_begin_heap instead, as tuplesort does?

I haven't looked at all into what the implications of this would be,
either from a performance or number-of-places-to-change standpoint.
But it seems worth a bit of investigation while we're touching the
code.

Other than that issue, the patch seems OK in a quick once-over.

            regards, tom lane

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: DTrace probe patch for OS X Leopard
Next
From: Peter Eisentraut
Date:
Subject: Re: DTrace probe patch for OS X Leopard