Re: extended stats on partitioned tables

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
Cc: Zhihong Yu <zyu(at)yugabyte(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: extended stats on partitioned tables
Date: 2021-12-12 18:27:22
Message-ID: 105522.1639333642@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com> writes:
> On 12/12/21 16:37, Zhihong Yu wrote:
>> 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.

FWIW, I agree. Also, it's possible that future patches would create a
need to touch the RTE again nearby, in which case having the variable
makes it easier to write non-crummy code for that.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2021-12-12 21:29:39 Re: extended stats on partitioned tables
Previous Message Justin Pryzby 2021-12-12 17:52:56 Re: extended stats on partitioned tables