Re: Avoid double lookup in pgstat_fetch_stat_tabentry() - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject Re: Avoid double lookup in pgstat_fetch_stat_tabentry()
Date
Msg-id CALj2ACW4t3=aaobZT-NLh04DEKBFWOY1ET3u8JxGsFgW9hUv5A@mail.gmail.com
Whole thread Raw
In response to Re: Avoid double lookup in pgstat_fetch_stat_tabentry()  ("Drouvot, Bertrand" <bertranddrouvot.pg@gmail.com>)
List pgsql-hackers
On Fri, Nov 18, 2022 at 3:41 PM Drouvot, Bertrand
<bertranddrouvot.pg@gmail.com> wrote:
>
> > However, I have a suggestion to simplify it
> > further by getting rid of the local variable tabentry and just
> > returning pgstat_fetch_stat_tabentry_ext(IsSharedRelation(relid),
> > relid);. Furthermore, the pgstat_fetch_stat_tabentry() can just be a
> > static inline function.
> Good point. While at it, why not completely get rid of
> pgstat_fetch_stat_tabentry_ext(), like in v2 the attached?

Hm. While it saves around 20 LOC, IsSharedRelation() is now spread
across, but WFM.

--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: "Drouvot, Bertrand"
Date:
Subject: Re: Split index and table statistics into different types of stats
Next
From: Etsuro Fujita
Date:
Subject: Re: postgres_fdw: batch inserts vs. before row triggers