postgresql/src/include/tcop
David Rowley ac99802080 Speed up creation of command completion tags
The building of command completion tags could often be seen showing up in
profiles when running high tps workloads.

The query completion tags were being built with snprintf, which is slow at
the best of times when compared with more manual ways of formatting
strings.  Here we introduce BuildQueryCompletionString() to do this job
for us.  We also now store the completion tag's strlen in the
CommandTagBehavior struct so that we can quickly memcpy this number of
bytes into the completion tag string.  Appending the rows affected is done
via pg_ulltoa_n.  BuildQueryCompletionString returns the length of the
built string.  This saves us having to call strlen to figure out how many
bytes to pass to pq_putmessage().

Author: David Rowley, Andres Freund
Reviewed-by: Andres Freund
Discussion: https://postgr.es/m/CAHoyFK-Xwqc-iY52shj0G+8K9FJpse+FuZ36XBKy78wDVnd=Qg@mail.gmail.com
2022-12-16 10:31:25 +13:00
..
cmdtag.h Speed up creation of command completion tags 2022-12-16 10:31:25 +13:00
cmdtaglist.h Allow event trigger table_rewrite for ALTER MATERIALIZED VIEW 2022-08-17 14:55:20 +09:00
deparse_utility.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
dest.h Speed up creation of command completion tags 2022-12-16 10:31:25 +13:00
fastpath.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pquery.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
tcopprot.h Split up guc.c for better build speed and ease of maintenance. 2022-09-13 11:11:45 -04:00
utility.h Update copyright for 2022 2022-01-07 19:04:57 -05:00