diff options
author | Andres Freund <andres@anarazel.de> | 2017-09-19 11:46:07 -0700 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2017-09-19 12:51:14 -0700 |
commit | 54b6cd589ac2f5635a42511236a5eb7299e2dcaf (patch) | |
tree | d3ee7ba947177ad35c4ed42bf221bd850b7ea0aa /src/backend/access/gist/gistvacuum.c | |
parent | d1687c6926819f023c78b353458950a303796aba (diff) | |
download | postgresql-54b6cd589ac2f5635a42511236a5eb7299e2dcaf.tar.gz postgresql-54b6cd589ac2f5635a42511236a5eb7299e2dcaf.zip |
Speedup pgstat_report_activity by moving mb-aware truncation to read side.
Previously multi-byte aware truncation was done on every
pgstat_report_activity() call - proving to be a bottleneck for
workloads with long query strings that execute quickly.
Instead move the truncation to the read side, which commonly is
executed far less frequently. That's possible because all server
encodings allow to determine the length of a multi-byte string from
the first byte.
Rename PgBackendStatus.st_activity to st_activity_raw so existing
extension users of the field break - their code has to be adjusted to
use pgstat_clip_activity().
Author: Andres Freund
Tested-By: Khuntal Ghosh
Reviewed-By: Robert Haas, Tom Lane
Discussion: https://postgr.es/m/20170912071948.pa7igbpkkkviecpz@alap3.anarazel.de
Diffstat (limited to 'src/backend/access/gist/gistvacuum.c')
0 files changed, 0 insertions, 0 deletions