Re: Use %u to print user mapping's umid and userid - Mailing list pgsql-hackers

From Etsuro Fujita
Subject Re: Use %u to print user mapping's umid and userid
Date
Msg-id 481d5b6f-7017-5e33-7926-d9139284bd8e@lab.ntt.co.jp
Whole thread Raw
In response to Re: Use %u to print user mapping's umid and userid  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
Responses Re: Use %u to print user mapping's umid and userid
List pgsql-hackers
On 2016/05/11 18:03, Ashutosh Bapat wrote:
> On Wed, May 11, 2016 at 1:34 PM, Etsuro Fujita
> <fujita.etsuro@lab.ntt.co.jp <mailto:fujita.etsuro@lab.ntt.co.jp>> wrote:

>     On 2016/05/11 16:49, Ashutosh Bapat wrote:
>
>         The patch is calculating user mapping when it's readily available
>         through RelOptInfo::fdw_private. That incurs a catalog lookup
>         unnecessarily. Instead, can we add new function makeOid, oidVal
>         on the
>         lines of makeInteger and intVal to store and retrieve an OID
>         resp. and
>         also corresponding print function? It might be helpful in future.

>     That might be an idea, but is the overhead in that re-calculation so
>     large?

> A call to GetForeignTable would incur a catalog lookup which means a
> catalog table/index scan if corresponding entry is not in the cache.
> This is followed by GetUserMapping() which is another catalog access.
> That's bound to be expensive than an makeOid(), oidVal() call.

Right, but such lookups have been incurred at the planning time (ie, 
build_simple_rel), and corresponding entries would be in the cache.  So, 
the overhead in that recalculation at the execution time would be not 
that large in practice.  No?

Best regards,
Etsuro Fujita





pgsql-hackers by date:

Previous
From: Rajeev rastogi
Date:
Subject: Re: Academic help for Postgres
Next
From: Michael Paquier
Date:
Subject: Re: Vacuum Full by Scheme