Amazon Athena
User Guide  | API Reference

Viewing Query History

To view your recent query history, use History. Athena retains query history for 45 days.

Note

Starting on December 1, 2017, Athena retains query history for 45 days.

To retain query history for a longer period, write a Java program using methods from Athena API and the AWS CLI to periodically retrieve the query history and save it to a data store:

  1. Retrieve the query IDs with ListQueryExecutions.
  2. Retrieve information about each query based on its ID with GetQueryExecution.
  3. Save the obtained information in a data store, such as Amazon S3, using the put-object AWS CLI command from the Amazon S3 API.

Viewing Query History#

  1. To view a query in your history for up to 45 days after it ran, choose History and select a query. You can also see which queries succeeded and failed, download their results, and view query IDs, by clicking the status value.
_images/query_history.png