Re: Reusing return value from planner_rt_fetch - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Reusing return value from planner_rt_fetch
Date
Msg-id 1054256.1667267269@sss.pgh.pa.us
Whole thread Raw
In response to Reusing return value from planner_rt_fetch  (Zhihong Yu <zyu@yugabyte.com>)
List pgsql-hackers
Zhihong Yu <zyu@yugabyte.com> 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



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: heapgettup refactoring
Next
From: Bharath Rupireddy
Date:
Subject: Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?