Re: Faster methods for getting SPI results (460% improvement)

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: Faster methods for getting SPI results (460% improvement)
Дата
Msg-id CAMsr+YHxiXmYVsv01mfS-xTh5oc2KtHmK_=oD_1iPCF=KWskHw@mail.gmail.com
обсуждение исходный текст
Ответ на [HACKERS] Faster methods for getting SPI results  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Список pgsql-hackers
On 6 April 2017 at 15:38, Craig Ringer <craig@2ndquadrant.com> wrote:

> Notes on the docs aside, I am pretty happy with this and think it's
> reasonable to proceed with it for Pg 10.

Actually, I'm a bit hesitant about returning a static struct that you
expect callers to copy and modify.  But it seems to be an issue with
CreateDestReceiver's interface where it mixes returning pointers to
static structs with returning pointers to palloc'd memory, not a new
issue added by this patch.

I think you're better off bypassing CreateDestReceiver here, and doing
what CreateTransientRelDestReceiver(), etc do directly instead. That
way there's no need for the hoop jumping of returning a pointer to a
static struct to memcpy() into another struct in:

+    memcpy(&(callback->pub), CreateDestReceiver(DestSPICallback),
sizeof(DestReceiver));

Just document that the spi callback struct must have DestReciever as
its first member and must be palloc0'd.

But otherwise, pending docs changes, I think it's ready for committer.

-- Craig Ringer                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: Faster methods for getting SPI results (460% improvement)
Следующее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Collect and use multi-columndependency stats