Re: build array of composites in SPI

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: build array of composites in SPI
Date: 2009-11-17 18:07:12
Message-ID: 1535.1258481232@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Merlin Moncure <mmoncure(at)gmail(dot)com> writes:
> 2) build the composite via:
> 2a) TupleDescGetAttInMetadata
> 2b) BuildTupleFromCStrings
> 2c) get datum/HeapTupleGetDatum

If it's performance critical, you might want to avoid the extra overhead
of the AttInMetadata API. Especially if you know the column datatypes
ahead of time, and even more especially if you have the values in datum
rather than C-string form. Consider using heap_form_tuple directly.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alexey Klyukin 2009-11-17 18:32:04 Re: plperl: spi_query_prepared/spi_fetchrow versus spi_exec_prepared: memory?
Previous Message Nick 2009-11-17 17:11:18 Re: Can anyone help setting up pgbouncer?