neon 4.10.0 → 4.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -871,7 +871,7 @@ All sub-commands honor the [global options](#global-options), including `--outpu
871
871
 
872
872
  ## Database diagnostics (`inspect`)
873
873
 
874
- `neon inspect db stalled-queries` takes a read-only snapshot of active queries that have run for more than 30 seconds and groups parallel workers with their leader. Table output shows duration, wait event, blocking pids, role, query group, and query. `--output json` adds timestamps, query IDs, pids, database, and the rest of the row. A blocking pid can belong to an idle-in-transaction backend this command does not list; `neon inspect db locks` shows lock holders.
874
+ `neon inspect db stalled-queries` takes a read-only snapshot of active queries that have run for more than 30 seconds and groups parallel workers with their leader. Oldest group first. Table output shows duration, wait event, blocking pids, role, query group, and query. `--output json` adds timestamps, query IDs, pids, database, and the rest of the row. A blocking pid can belong to an idle-in-transaction backend this command does not list; `neon inspect db locks` shows lock holders.
875
875
 
876
876
  ```bash
877
877
  neon inspect db stalled-queries
@@ -112,7 +112,7 @@ const INSPECT_QUERIES = {
112
112
  `
113
113
  },
114
114
  "stalled-queries": {
115
- describe: "Active queries running longer than 30 seconds with parallel workers, waits, and blockers (compute-wide)",
115
+ describe: "Active queries running longer than 30 seconds with parallel workers, waits, and blockers, oldest group first (compute-wide)",
116
116
  scope: "compute",
117
117
  fields: [
118
118
  "duration",
@@ -132,9 +132,12 @@ const INSPECT_QUERIES = {
132
132
  AND pid <> pg_backend_pid()
133
133
  ),
134
134
  stalled_groups AS (
135
- SELECT DISTINCT COALESCE(leader_pid, pid) AS query_group
135
+ SELECT
136
+ COALESCE(leader_pid, pid) AS query_group,
137
+ min(query_start) AS group_start
136
138
  FROM activity
137
139
  WHERE query_start <= statement_timestamp() - interval '30 seconds'
140
+ GROUP BY COALESCE(leader_pid, pid)
138
141
  )
139
142
  SELECT
140
143
  statement_timestamp() AS observed_at,
@@ -159,7 +162,7 @@ const INSPECT_QUERIES = {
159
162
  FROM activity a
160
163
  JOIN stalled_groups g
161
164
  ON g.query_group = COALESCE(a.leader_pid, a.pid)
162
- ORDER BY g.query_group, a.leader_pid NULLS FIRST, a.pid;
165
+ ORDER BY g.group_start, g.query_group, a.leader_pid NULLS FIRST, a.pid;
163
166
  `
164
167
  },
165
168
  locks: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neon",
3
- "version": "4.10.0",
3
+ "version": "4.10.1",
4
4
  "description": "CLI tool for Neon, the cloud backend primitives built around Lakebase Postgres",
5
5
  "keywords": [
6
6
  "neon",