Re: Can avoid list_copy in recomputeNamespacePath() conditionally?

From: amul sul <sulamul(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Can avoid list_copy in recomputeNamespacePath() conditionally?
Date: 2019-11-04 05:03:25
Message-ID: CAAJ_b94aokxZBDqR+B0EZn21pgd5ES+-cFKdp8KY2UWUDT5D0A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Nov 2, 2019 at 8:01 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> amul sul <sulamul(at)gmail(dot)com> writes:
> > I wondered can we have a shortcut somewhat similar to following POC
> > in recomputeNamespacePath () when the recomputed path is the same as the
> > previous baseSearchPath/activeSearchPath :
> > + /* TODO: POC */
> > + if (equal(oidlist, baseSearchPath))
> > + return;
>
> There's an awful lot missing from that sketch; all of the remaining
> steps still need to be done:
>
>
You are correct, but that was intentionally skipped to avoid longer post
descriptions for the initial discussion. Sorry for being little lazy.

> baseCreationNamespace = firstNS;
> baseTempCreationPending = temp_missing;
>
> /* Mark the path valid. */
> baseSearchPathValid = true;
> namespaceUser = roleid;
>
> /* And make it active. */
> activeSearchPath = baseSearchPath;
> activeCreationNamespace = baseCreationNamespace;
> activeTempCreationPending = baseTempCreationPending;
>
> /* Clean up. */
> pfree(rawname);
> list_free(namelist);
> list_free(oidlist);
>
> More to the point, I think the onus would be on the patch submitter
> to prove that the extra complexity had some measurable benefit.
> I really doubt that it would, since the list_copy is surely trivial
> compared to the catalog lookup work we had to do to compute the OID
> list above here.
>

Agree.

> It'd likely be more useful to see if you could reduce the number of
> places where we have to invalidate the path in the first place.
>

Understood, let me check.

Regards,
Amul

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2019-11-04 05:15:01 Re: [HACKERS] Block level parallel vacuum
Previous Message Amit Kapila 2019-11-04 05:01:55 Re: [HACKERS] Block level parallel vacuum