Re: Why do we have MakeSingleTupleTableSlot instead of not using MakeTupleTableSlot?

Поиск
Список
Период
Сортировка
От Zhihong Yu
Тема Re: Why do we have MakeSingleTupleTableSlot instead of not using MakeTupleTableSlot?
Дата
Msg-id CALNJ-vQSqRuZ98crM+DRUajNuN0FyBSv-nU9+S-vsS-n=-YFVg@mail.gmail.com
обсуждение исходный текст
Ответ на Why do we have MakeSingleTupleTableSlot instead of not using MakeTupleTableSlot?  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Ответы Re: Why do we have MakeSingleTupleTableSlot instead of not using MakeTupleTableSlot?  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Список pgsql-hackers
Hi,
MakeSingleTupleTableSlot can be defined as a macro, calling MakeTupleTableSlot().

Cheers

On Fri, Feb 12, 2021 at 5:44 AM Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> wrote:
Hi,

I wonder, is there a specific reason that MakeTupleTableSlot is
wrapped up in MakeSingleTupleTableSlot without doing anything than
just returning the slot created by MakeTupleTableSlot? Do we really
need MakeSingleTupleTableSlot? Can't we just use MakeTupleTableSlot
directly? Am I missing something?

I think we can avoid some unnecessary function call costs, for
instance when called 1000 times inside table_slot_create from
copyfrom.c or in some other places where MakeSingleTupleTableSlot is
called in a loop.

If it's okay to remove MakeSingleTupleTableSlot and use
MakeTupleTableSlot instead, we might have to change in a lot of
places. If we don't want to change in those many files, we could
rename MakeTupleTableSlot to MakeSingleTupleTableSlot and change it in
only a few places.

Thoughts?

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com


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

Предыдущее
От: Ranier Vilela
Дата:
Сообщение: Re: Possible dereference null return (src/backend/replication/logical/reorderbuffer.c)
Следующее
От: Ranier Vilela
Дата:
Сообщение: Re: Possible dereference after null check (src/backend/executor/ExecUtils.c)