postgresql/src/backend
Andres Freund 54b6cd589a 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
2017-09-19 12:51:14 -07:00
..
access Fix crash restart bug introduced in 8356753c21. 2017-09-18 17:25:49 -07:00
bootstrap Remove unnecessary parentheses in return statements 2017-09-05 14:52:55 -04:00
catalog Make RelationGetPartitionDispatchInfo expand depth-first. 2017-09-14 12:28:50 -04:00
commands Make ExplainOpenGroup and ExplainCloseGroup public. 2017-09-18 16:01:16 -04:00
executor Fix SQL-spec incompatibilities in new transition table feature. 2017-09-16 13:20:36 -04:00
foreign
lib Fix uninitialized variable in dshash.c. 2017-09-18 17:43:37 -07:00
libpq Define LDAP_NO_ATTRS if necessary. 2017-09-13 08:22:42 -04:00
main Change pg_ctl to detect server-ready by watching status in postmaster.pid. 2017-06-28 17:31:32 -04:00
nodes Allow a partitioned table to have a default partition. 2017-09-08 17:28:04 -04:00
optimizer Allow rel_is_distinct_for() to look through RelabelType below OpExpr. 2017-09-17 15:28:51 -04:00
parser After a MINVALUE/MAXVALUE bound, allow only more of the same. 2017-09-15 21:15:55 -04:00
po Translation updates 2017-08-07 13:55:34 -04:00
port
postmaster Speedup pgstat_report_activity by moving mb-aware truncation to read side. 2017-09-19 12:51:14 -07:00
regex Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
replication Fix, or at least ameliorate, bugs in logicalrep_worker_launch(). 2017-09-18 11:39:55 -04:00
rewrite Message style fixes 2017-09-11 11:21:27 -04:00
snowball Initial pgindent run with pg_bsd_indent version 2.0. 2017-06-21 14:39:04 -04:00
statistics Remove obsolete comments about functional dependencies 2017-07-26 11:40:39 -04:00
storage Add support for coordinating record typmods among parallel workers. 2017-09-14 19:59:21 -07:00
tcop Rearm statement_timeout after each executed query. 2017-09-18 19:36:44 -07:00
tsearch Make DatumGetFoo/PG_GETARG_FOO/PG_RETURN_FOO macro names more consistent. 2017-09-18 15:21:23 -04:00
utils Speedup pgstat_report_activity by moving mb-aware truncation to read side. 2017-09-19 12:51:14 -07:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk
Makefile
nls.mk Translation updates 2017-05-15 12:19:54 -04:00