Re: track_planning causing performance regression
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: Julien Rouhaud <rjuju123@gmail.com>, "Tharakan, Robins" <tharar@amazon.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2020-06-29T23:10:15Z
Lists: pgsql-hackers
Hi, On 2020-06-29 17:55:28 +0900, Fujii Masao wrote: > One idea to reduce that lock contention is to separate per-query spinlock > into two; one is for planning, and the other is for execution. pgss_store() > determines which lock to use based on the given "kind" argument. > To make this idea work, also every pgss counters like shared_blks_hit > need to be separated into two, i.e., for planning and execution. I suspect that the best thing would be to just turn the spinlock into an lwlock. Spinlocks deal terribly with contention. I suspect it'd solve the performance issue entirely. And it might even be possible, further down the line, to just use a shared lock, and use atomics for the counters. Greetings, Andres Freund
Commits
-
doc: Fix description about pg_stat_statements.track_planning.
- 306c5e05e20f 13.4 landed
- e48f2afee631 14.0 landed
- 9d2a7757347c 15.0 landed
-
doc: Add note about possible performance overhead by enabling track_planning.
- da6b6ff95bca 13.0 landed
- 321fa6a4a26c 14.0 landed
-
Change default of pg_stat_statements.track_planning to off.
- 8d459762b103 13.0 landed
- d1763ea8c9c3 14.0 landed