Re: More efficient truncation of pg_stat_activity query strings

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Kuntal Ghosh <kuntalghosh.2007@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2017-09-19T18:49:18Z
Lists: pgsql-hackers
Hi,

On 2017-09-15 17:43:35 +0530, Kuntal Ghosh wrote:
> The patch looks good to me. I've done some regression testing with a
> custom script on my local system. The script contains the following
> statement:

> SELECT 'aaa..<repeated 600 times>' as col;
> 
> Test 1
> -----------------------------------
> duration: 300 seconds
> clients/threads: 1

> With the patch TPS:13628 (+3.39%)
> +    0.36%     0.21%  postgres  postgres  [.] pgstat_report_activity
> 
> Test 2
> -----------------------------------
> duration: 300 seconds
> clients/threads: 8

> With the patch TPS: 63949 (+20.4%)
> +    0.40%     0.25%  postgres  postgres  [.] pgstat_report_activity
> 
> This shows the significance of this patch in terms of performance
> improvement of pgstat_report_activity. Is there any other tests I
> should do for the same?

Thanks for the test! I think this looks good, no further tests
necessary.

Greetings,

Andres Freund


Commits

  1. Speedup pgstat_report_activity by moving mb-aware truncation to read side.