public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tomas Vondra <[email protected]>
To: Zhihong Yu <[email protected]>
Cc: Justin Pryzby <[email protected]>
Cc: Jaime Casanova <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Subject: Re: extended stats on partitioned tables
Date: Sun, 12 Dec 2021 18:52:00 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <CALNJ-vSbxsOOUfCunuRsJ=pzSPnJuTnSVTMLh3486ZKPeN6=qg@mail.gmail.com>
References: <[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<20211007202646.GA9522@ahch-to>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CALNJ-vQSpBxw-gjZ--p-vo_yr2yHaXXOn_g8i=DQam_aAW3GwQ@mail.gmail.com>
	<[email protected]>
	<CALNJ-vSbxsOOUfCunuRsJ=pzSPnJuTnSVTMLh3486ZKPeN6=qg@mail.gmail.com>

On 12/12/21 16:37, Zhihong Yu wrote:
> 
> Hi,
> For patch 1, minor comment:
> 
> +           if (planner_rt_fetch(onerel->relid, root)->inh)
> 
> Since the rte (RangeTblEntry*) doesn't seem to be used beyond checking 
> inh, I think it would be better if the above style of checking is used 
> throughout the patch (without introducing rte variable).
> 

It's mostly a matter of personal taste, but I always found this style of 
condition (i.e. dereferencing a pointer returned by a function) much 
less readable. It's hard to parse what exactly is happening, what struct 
type are we dealing with, etc. YMMV but the separate variable makes it 
much clearer for me. And I'd expect the compilers to produce pretty much 
the same code too for those cases.


regards

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company





view thread (33+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: extended stats on partitioned tables
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox