Skip to main content
You can use the information_schema.engine_query_history view to return information about queries saved to query history. The view is available in each database and contains two rows, the starting and ending row for each historical query in the database. The table includes the last ten thousand queries per engine cluster. You can run a SELECT query to retrieve details about recent queries, as shown in the following example:
The information_schema.engine_query_history view retains only the most recent 10,000 queries. Queries exceeding this limit are excluded and will not appear in the query history. This limitation is important for high-volume workloads and tools like the OTEL exporter, which can rapidly fill the query history. To retain critical query data, regularly export or archive query history.

Columns in information_schema.engine_query_history

Each row has the following columns with information about each query in query history.