Re: extended stats on partitioned tables

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема Re: extended stats on partitioned tables
Дата
Msg-id 8bd5bb15-906c-6682-0f50-394fbc2a4a15@enterprisedb.com
обсуждение исходный текст
Ответ на Re: extended stats on partitioned tables  (Zhihong Yu <zyu@yugabyte.com>)
Ответы Re: extended stats on partitioned tables  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: extended stats on partitioned tables
Следующее
От: Tom Lane
Дата:
Сообщение: Re: extended stats on partitioned tables