public inbox for [email protected]  
help / color / mirror / Atom feed
From: Costa Alexoglou <[email protected]>
To: [email protected] <[email protected]>
Subject: Empty query_id in pg_stat_activity
Date: Fri, 6 Dec 2024 15:32:18 +0100
Message-ID: <CAJ+5Ff4sLuTMpg__fZH67UdaC2bWpLK1U3a8kkj_BvqO8ScYQw@mail.gmail.com> (raw)

Hey folks, I am running Benchbase and pgbench at the same time just for
debugging purposes, and I notice that sometimes query_id is missing
from pg_stat_activity. Any clue why this is happening?

```
benchbase=# SELECT query_id, now() - query_start as duration, query FROM
pg_stat_activity WHERE state = 'active' AND backend_type = 'client backend'
ORDER BY duration DESC LIMIT 5; query_id | duration | query
---------------------+------------------+------------------------------------------------------------------------
| 00:00:00.223544 | SELECT + | | s_suppkey, + | | s_name, + | | s_address,
+ | | s_phone, + | | total_revenue + | | FROM + | | supplier, + | |
revenue0 + | | WHERE + | | s_suppkey = supplier_no + | | AND total_revenue
= ( + | | SELECT + | | MAX(total_revenue) + | | FROM + | | revenue0 + | | )
+ | | ORDER BY + | | s_suppkey + | | 3080582906387216276 | 00:00:00.000032
| UPDATE pgbench_branches SET bbalance = bbalance + -4897 WHERE bid = 8;
3080582906387216276 | -00:00:00.000321 | UPDATE pgbench_branches SET
bbalance = bbalance + -377 WHERE bid = 6; 2064869707185898531 |
-00:00:00.000501 | END; 2064869707185898531 | -00:00:00.000502 | END; (5
rows)
```

Cheers,
Costa


view thread (3+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Empty query_id in pg_stat_activity
  In-Reply-To: <CAJ+5Ff4sLuTMpg__fZH67UdaC2bWpLK1U3a8kkj_BvqO8ScYQw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox