Stored query results
Stored query results store the result of a query on the service for up to 24 hours. The same principal identity that created the stored query can reference the results in later queries.
Stored query results can be useful in the following scenarios:
- Paging through query results. The initial command runs the query and returns the first “page” of records. Later queries reference other “pages” without the need to rerun the query.
- Drill-down scenarios, in which the results of an initial query are then explored using other queries.
Updates to security policies, such as database access and row level security, aren’t propagated to stored query results. Use .drop stored_query_results if there’s user permission revocation.
Stored query results behave like tables, in that the order of records isn’t preserved. To paginate through the results, we recommended that the query includes unique ID columns. If a query returns multiple result sets, only the first result set is stored.
The following table lists the management commands and functions used for managing stored query results:
| Command | Description |
|---|---|
| .set stored_query_result command | Creates a stored query result to store the results of a query on the service for up to 24 hours. |
| .show stored_query_result command | Shows information on active query results. |
| .drop stored_query_result command | Deletes active query results. |
| stored_query_result() | Retrieves a stored query result. |
Related Content
- Stored functions
- Pin a query to Azure Data Explorer dashboards
- Add a query to a Real-Time Dashboard tile
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.