public inbox for [email protected]
help / color / mirror / Atom feed[PATCH v2 1/2] Ignore parallel workers in pg_stat_statements.
3+ messages / 3 participants
[nested] [flat]
* [PATCH v2 1/2] Ignore parallel workers in pg_stat_statements.
@ 2021-04-08 05:59 Julien Rouhaud <[email protected]>
0 siblings, 0 replies; 3+ messages in thread
From: Julien Rouhaud @ 2021-04-08 05:59 UTC (permalink / raw)
Oversight in 4f0b0966c8 which exposed queryid in parallel workers. Counters
are aggregated by the main backend process so parallel workers would report
duplicated activity, and could also report activity for the wrong entry as they
are only aware of the top level queryid.
Author: Julien Rouhaud
Reported-by: Andres Freund
Discussion: https://postgr.es/m/[email protected]
---
contrib/pg_stat_statements/pg_stat_statements.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/contrib/pg_stat_statements/pg_stat_statements.c b/contrib/pg_stat_statements/pg_stat_statements.c
index fc2677643b..dbd0d41d88 100644
--- a/contrib/pg_stat_statements/pg_stat_statements.c
+++ b/contrib/pg_stat_statements/pg_stat_statements.c
@@ -47,6 +47,7 @@
#include <sys/stat.h>
#include <unistd.h>
+#include "access/parallel.h"
#include "catalog/pg_authid.h"
#include "common/hashfn.h"
#include "executor/instrument.h"
@@ -278,8 +279,9 @@ static bool pgss_save; /* whether to save stats across shutdown */
#define pgss_enabled(level) \
+ (!IsParallelWorker() && \
(pgss_track == PGSS_TRACK_ALL || \
- (pgss_track == PGSS_TRACK_TOP && (level) == 0))
+ (pgss_track == PGSS_TRACK_TOP && (level) == 0)))
#define record_gc_qtexts() \
do { \
--
2.30.1
--lf3monmlgf7s3cjf
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v2-0002-Fix-thinko-in-pg_stat_get_activity-when-retrievin.patch"
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: remove the unneeded header file math.h in binaryheap.c
@ 2026-01-15 07:58 =?utf-8?B?bGl1amlueWFuZw==?= <[email protected]>
0 siblings, 1 reply; 3+ messages in thread
From: =?utf-8?B?bGl1amlueWFuZw==?= @ 2026-01-15 07:58 UTC (permalink / raw)
To: =?utf-8?B?w4FsdmFybyBIZXJyZXJh?= <[email protected]>; +Cc: =?utf-8?B?cGdzcWwtaGFja2Vycw==?= <[email protected]>
Hi Alvora,
thanks for your review.
So wha't the next should I do for commit it, because this is my first patch.
Best Regards
liujinyang
原始邮件
发件人:Álvaro Herrera <[email protected]>
发件时间:2026年1月14日 01:18
收件人:liujinyang <[email protected]>
抄送:pgsql-hackers <[email protected]>
主题:Re: remove the unneeded header file math.h in binaryheap.c
On 2026-Jan-13, liujinyang wrote:
> Hi Hackers,
>
> I found in file binaryheap.c, file "math.h" was included, but it is uncessary, so I removed it&nbsp;
> and filing a patch to address the issue.
Fun. This was already unnecessary at commit 7a2fe9bd0371 which
introduced the file. It seems Abhijit had that include in his first
version [1] because he was using floor(). Robert rewrote it later [2]
and replaced that with straight arithmetic, making the include
unnecessary, but forgot to remove it.
[1] https://postgr.es/m/[email protected]
[2] https://postgr.es/m/CA%2BTgmobvR7XW9fjj2RNY7sKK-VAG5nahfai_zV51rHVLDNvaBg%40mail.gmail.com
--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: remove the unneeded header file math.h in binaryheap.c
@ 2026-01-15 10:47 Álvaro Herrera <[email protected]>
parent: =?utf-8?B?bGl1amlueWFuZw==?= <[email protected]>
0 siblings, 0 replies; 3+ messages in thread
From: Álvaro Herrera @ 2026-01-15 10:47 UTC (permalink / raw)
To: liujinyang <[email protected]>; +Cc: pgsql-hackers <[email protected]>
On 2026-01-15, liujinyang wrote:
> Hi Alvora,
> thanks for your review.
> So wha't the next should I do for commit it, because this is my first patch.
Nothing. I'll push it soon, no worries.
In the future, if patches don't get committed in a day or so, you can add them to a commitfest so that they aren't forgotten -- see https://commitfest.postgresql.org.
--
Álvaro Herrera
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2026-01-15 10:47 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-04-08 05:59 [PATCH v2 1/2] Ignore parallel workers in pg_stat_statements. Julien Rouhaud <[email protected]>
2026-01-15 07:58 Re: remove the unneeded header file math.h in binaryheap.c =?utf-8?B?bGl1amlueWFuZw==?= <[email protected]>
2026-01-15 10:47 ` Re: remove the unneeded header file math.h in binaryheap.c Álvaro Herrera <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox