You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SELECTsubstring(statement, 1, 60) AS statement_text,
plan_id,
string_agg(plan_line, e'\n') AS plan,
max(timestamp_interval),
max(num_rows_read_mean),
max(runtime_latency_mean)
FROM (
SELECT
metadata->>'query'AS statement,
statistics->'statistics'->'planGists'->>0as plan_id,
max(aggregated_ts) as timestamp_interval,
max(statistics->'statistics'->'rowsRead'->'mean') AS num_rows_read_mean,
max(statistics->'statistics'->'runLat'->'mean') AS runtime_latency_mean
FROMcrdb_internal.statement_statisticsWHERE
metadata->>'query'LIKE'SELECT %'GROUP BY
metadata->>'query', statistics->'statistics'->'planGists'->>0
) AS x,
LATERAL crdb_internal.decode_plan_gist(plan_id) AS y(plan_line)
GROUP BY
statement, plan_id;
Michael Erickson (michae2) commented:
The SQL query used in https://www.cockroachlabs.com/docs/stable/crdb-internal#detect-suboptimal-and-regressed-plans is no longer valid in 23.2. (
crdb_internal.decode_plan_gist
is a set-returning function which is no longer allowed directly insidestring_agg
, an aggregate function.)How about something like this instead?
Jira Issue: DOC-9851
The text was updated successfully, but these errors were encountered: