Skip to main content

query_runtime_statistics

Creates, updates, deletes, gets or lists a query_runtime_statistics resource.

Overview

Namequery_runtime_statistics
TypeResource
Idaws.athena.query_runtime_statistics

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
output_stageobjectStage statistics such as input and output rows and bytes, execution time, and stage state. This information also includes substages and the query stage plan.
rowsobjectStatistics such as input rows and bytes read by the query, rows and bytes output by the query, and the number of rows written by the query.
timelineobjectTimeline statistics such as query queue time, planning time, execution time, service processing time, and total execution time.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_query_runtime_statisticsselectregionReturns query execution runtime statistics related to a single execution of a query if you have access to the workgroup in which the query ran. Statistics from the Timeline section of the response object are available as soon as QueryExecutionStatus$State is in a SUCCEEDED or FAILED state. The remaining non-timeline statistics in the response (like stage-level input and output row count and data size) are updated asynchronously and may not be available immediately after a query completes or, in some cases, may not be returned. The non-timeline statistics are also not included when a query has row-level filters defined in Lake Formation.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Returns query execution runtime statistics related to a single execution of a query if you have access to the workgroup in which the query ran. Statistics from the Timeline section of the response object are available as soon as QueryExecutionStatus$State is in a SUCCEEDED or FAILED state. The remaining non-timeline statistics in the response (like stage-level input and output row count and data size) are updated asynchronously and may not be available immediately after a query completes or, in some cases, may not be returned. The non-timeline statistics are also not included when a query has row-level filters defined in Lake Formation.

SELECT
output_stage,
rows,
timeline
FROM aws.athena.query_runtime_statistics
WHERE region = '{{ region }}' -- required
;