Reusing return value from planner_rt_fetch

Поиск
Список
Период
Сортировка
Искать

Reusing return value from planner_rt_fetch

От:
Zhihong Yu <zyu@yugabyte.com>
Дата:
Вложения:
Hi,
I was reading examine_variable in src/backend/utils/adt/selfuncs.c

It seems we already have the rte coming out of the loop which starts on line 5181.

Here is a patch which reuses the return value from `planner_rt_fetch`.

Please take a look.

Thanks

Re: Reusing return value from planner_rt_fetch

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Zhihong Yu  writes:
> I was reading examine_variable in src/backend/utils/adt/selfuncs.c
> It seems we already have the rte coming out of the loop which starts on
> line 5181.
> Here is a patch which reuses the return value from `planner_rt_fetch`.

planner_rt_fetch is not so expensive that we should contort the code
to avoid one call.  So I'm not sure this is an improvement.  It
doesn't seem to be more readable, and it adds assumptions on
whether appinfo is initially null or becomes so later.

			regards, tom lane


FAQ