Re: Speedup generation of command completion tags

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Speedup generation of command completion tags
Date: 2022-12-15 21:33:13
Message-ID: CAApHDvqbTpcWeuvQVa9kS0TXtnoVc6i-brGJS=V-qDUnR3rgaw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 12 Dec 2022 at 14:48, David Rowley <dgrowleyml(at)gmail(dot)com> wrote:
>
> On Sun, 11 Dec 2022 at 11:05, Andres Freund <andres(at)anarazel(dot)de> wrote:
> > What about moving make_completion_tag() to cmdtag.c? Then we could just get
> > the entire CommandTagBehaviour struct at once. It's not super pretty to pass
> > QueryCompletion to a routine in cmdtag.c, but it's not awful. And if we deem
> > it problematic, we could just pass qc->commandTag, qc->nprocessed as a
> > separate arguments.
>
> That seems like a good idea. I've renamed and moved the function in
> the attached. I also adjusted how the trailing NUL char is appended to
> avoid having to calculate len + 1 and append the NUL char twice for
> the most commonly taken path.

I've pushed the updated patch. Thanks for having a look.

David

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-12-15 21:57:16 Re: BUG #17717: Regression in vacuumdb (15 is slower than 10/11 and possible memory issue)
Previous Message Paul Ramsey 2022-12-15 20:53:40 Re: [PATCH] random_normal function