Re: Reusing return value from planner_rt_fetch

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Zhihong Yu <zyu(at)yugabyte(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Reusing return value from planner_rt_fetch
Date: 2022-11-01 01:47:49
Message-ID: 1054256.1667267269@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Zhihong Yu <zyu(at)yugabyte(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2022-11-01 03:02:48 Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?
Previous Message Andres Freund 2022-11-01 01:09:48 Re: heapgettup refactoring