Search Postgresql Archives

build array of composites in SPI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Trying to formulate a good strategy for $subject.  The code is
performance critical.

The composite type is simple: (text, text), that needs to be routed to
function call in array form.  The #elements in the array is small,
generally less than 10.

The approach I have now is this:
1) look up the oid for the composite and prepare tupledesc:
  1a) TypeGetTupleDesc
  2b) BlessTupleDesc

2) build the composite via:
  2a) TupleDescGetAttInMetadata
  2b) BuildTupleFromCStrings
  2c) get datum/HeapTupleGetDatum

3) repeat to 2 until I have a Datum for each tuple

4) construct_array(datums, ndatums, comp_oid, -1, false, false)

5) PointerGetDatum directly on the ArrayType to get the oid to pass to SPI_execp

Does this look reasonable?

merlin

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux