[HACKERS] 0/NULL/NIL assignments in build_*_rel()

Поиск
Список
Период
Сортировка
От Ashutosh Bapat
Тема [HACKERS] 0/NULL/NIL assignments in build_*_rel()
Дата
Msg-id CAFjFpRcnVDb1ukbuCJYWRTvMJ_c+mRj0w-5oPTbi5dPBmCg-yQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: [HACKERS] 0/NULL/NIL assignments in build_*_rel()  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,
Both build_simple_rel() and build_join_rel() allocate RelOptInfo using
makeNode(), which returned a zeroed out memory. The functions then
assign values like false, NULL, 0 or NIL which essentially contain
zero valued bytes. This looks like needless work. So, we are spending
some CPU cycles unnecessarily in those assignments. That may not be
much time wasted, but whenever someone adds a field to RelOptInfo,
those functions need to be updated with possibly a zero value
assignment. That looks like an unnecessary maintenance burden. Should
we just drop all those zero value assignments from there? If there's
any reason to have those assignments there, should we move the code to
allocate RelOptInfo and assign zero values to a separate function and
call it from those two functions? fetch_upper_rel() also has those
kinds of assignments, but they are far fewer than build_*_rel().

-- 
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company



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

Предыдущее
От: Kouhei Kaigai
Дата:
Сообщение: Re: ParallelFinish-hook of FDW/CSP (Re: [HACKERS] Steps insideExecEndGather)
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: [HACKERS] Provide list of subscriptions and publications inpsql's completion