sql: show allocated memory in SHOW SESSIONS#25395
sql: show allocated memory in SHOW SESSIONS#25395craig[bot] merged 1 commit intocockroachdb:masterfrom
SHOW SESSIONS#25395Conversation
|
Sorry for the delay in reviewing this! The objective of this change is to offer operators the ability to observe memory usage per session at the current point in time but I don't think this change is enough to allow for this because according to my understanding
I think this would be great to have, and some extensions could include showing the high watermark memory usage of a query (by using the same mechanism with statement monitors). |
|
Okay, PTAL. I added the high watermark of memory usage to the session. Also, I rebased this patch on top of #26108, which makes the query's txn memory monitor parent the flow memory monitor (for the gateway node only). |
|
Review status: all files reviewed at latest revision, all discussions resolved, some commit checks failed. pkg/sql/crdb_internal.go, line 846 at r2 (raw file):
This should default to zero in a mixed version cluster where it gets session information from a machine that has the old version, correct? Comments from Reviewable |
|
Review status: all files reviewed at latest revision, 1 unresolved discussion, some commit checks failed. pkg/sql/crdb_internal.go, line 846 at r2 (raw file): Previously, arjunravinarayan (Arjun Narayan) wrote…
Correct. Comments from Reviewable |
|
Review status: all files reviewed at latest revision, 1 unresolved discussion, some commit checks failed. Comments from Reviewable |
4ac24d0 to
281def5
Compare
Done. bors r+ |
Canceled |
``` root@localhost:26257/defaultdb> select session_id, active_queries, alloc_bytes, max_alloc_bytes from [show sessions]; +----------------------------------+--------------------------------------------------------------------------+-------------+-----------------+ | session_id | active_queries | alloc_bytes | max_alloc_bytes | +----------------------------------+--------------------------------------------------------------------------+-------------+-----------------+ | 153200ed085836810000000000000001 | SELECT session_id, active_queries, alloc_bytes, max_alloc_bytes FROM | 0 | 30720 | | | [SHOW CLUSTER SESSIONS] | | | | 153201699798a3170000000000000001 | SELECT * FROM lineitem JOIN a ON l_orderkey = a | 256000 | 1914880 | +----------------------------------+--------------------------------------------------------------------------+-------------+-----------------+ ``` Release note (sql change): `SHOW SESSIONS` now includes the number of currently allocated bytes by the session, and the maximum number of allocated bytes that the session ever owned at once. n.b. these numbers don't include the bytes allocated for this session by remote nodes.
|
bors r+ |
25395: sql: show allocated memory in `SHOW SESSIONS` r=jordanlewis a=jordanlewis Release note (sql change): `SHOW SESSIONS` now includes the number of allocated bytes by the session. 25860: distsql: support tuples r=arjunravinarayan a=arjunravinarayan Release note (feature): using tuples in a query no longer reverts you to single node local SQL execution. Co-authored-by: Jordan Lewis <jordanthelewis@gmail.com> Co-authored-by: Arjun Narayan <arjun@cockroachlabs.com>
Build succeeded |
Release note (sql change):
SHOW SESSIONSnow includes the number ofallocated bytes by the session.