Re: pgsql: Remove some dead code in selfuncs.c

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org, Amit Langote <amitlangote09(at)gmail(dot)com>
Subject: Re: pgsql: Remove some dead code in selfuncs.c
Date: 2023-01-19 16:43:47
Message-ID: 4069769.1674146627@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

I wrote:
> Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
>> Remove some dead code in selfuncs.c
>> RelOptInfo.userid is the same for all relations in a given inheritance
>> tree, so the code in examine_variable() and example_simple_variable()
>> that repeats the ACL checks on the root parent rel instead of a given
>> leaf child relations need not recompute userid too.

> This change seems rather ill-advised.

Ah, sorry, -ENOCAFFEINE. It's talking about the access-as-user field,
not the relation's owner. I agree that as querytrees are currently
built, this is probably a safe optimization. But do we really want
to hard-wire such a subtle assumption to gain a microscopic speed
benefit? It's not as though GetUserId() is expensive.

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andrew Dunstan 2023-01-19 16:55:17 pgsql: Keep perl style checker happy
Previous Message Tom Lane 2023-01-19 15:45:34 Re: pgsql: Remove some dead code in selfuncs.c