I'm hoping to clarify my answer to your question. If I understand correctly, you want to see the statements behind errors from dc_errors. You will only be able to see the corresponding statement
IF it hasn't already been turned over in dc_requests_issued (following the data collection retention policies). If you look at the underlying definition for query_requests (it's a view), you'll see that it's actually joining on dc_errors:
Code: Select all
create view "v_monitor"."query_requests" as select ri.node_name,
ri.user_name,
ri.session_id,
ri.request_id,
ri.transaction_id,
ri.statement_id,
ri.request_type,
replace(replace(ri.request, E'\n', ' '), E'\t', ' ') as request,
ri.label as request_label,
ri.search_path,
round(ra.memory_mb, 2) as memory_acquired_mb,
rc.success,
de.error_count,
ri.time as start_timestamp,
rc.time as end_timestamp,
datediff('millisecond', ri.time, rc.time) as request_duration_ms,
rc.time IS NULL as is_executing
from
v_internal.dc_requests_issued ri
LEFT OUTER JOIN v_internal.dc_requests_completed rc USING (node_name, session_id, request_id)
LEFT OUTER JOIN (select node_name,
session_id,
request_id,
count(*) as error_count
from v_internal.dc_errors
where error_level >= 20
group by 1,2,3) de USING (node_name, session_id, request_id)
LEFT OUTER JOIN (select node_name,
transaction_id,
statement_id,
max(memory_kb)/1024::float as memory_mb
from v_internal.dc_resource_acquisitions
where result = 'Granted'
group by 1,2,3) ra
USING (node_name, transaction_id, statement_id)
order by is_executing desc, rc.time desc;