build array of composites in SPI

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема build array of composites in SPI
Дата
Msg-id b42b73150911170910k2d4ebec0gdd6b1d5b60685e4a@mail.gmail.com
обсуждение исходный текст
Ответы Re: build array of composites in SPI  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: Ivan Sergio Borgonovo
Дата:
Сообщение: impersonating a user/ownership problems
Следующее
От: Tom Lane
Дата:
Сообщение: Re: build array of composites in SPI