diff options
author | David Rowley <drowley@postgresql.org> | 2022-12-16 10:31:25 +1300 |
---|---|---|
committer | David Rowley <drowley@postgresql.org> | 2022-12-16 10:31:25 +1300 |
commit | ac998020802b742303979a13692afa7b2084d0e9 (patch) | |
tree | c731037569f34cc2f52c1d94c13c1130c2e41959 /contrib/postgres_fdw/sql/postgres_fdw.sql | |
parent | d35a1af468162f510b6139bf81a7a41fd8ba8500 (diff) | |
download | postgresql-ac998020802b742303979a13692afa7b2084d0e9.tar.gz postgresql-ac998020802b742303979a13692afa7b2084d0e9.zip |
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
Diffstat (limited to 'contrib/postgres_fdw/sql/postgres_fdw.sql')
0 files changed, 0 insertions, 0 deletions