docs/sources/visualizations/explore/query-management.md
Grafana Explore provides a variety of tools to help manage your queries.
{{< admonition type="note" >}} For help with debugging queries, Explore allows you to investigate query requests and responses, as well as query statistics, via the Query inspector. Refer to Query inspector in Explore for more information. {{< /admonition >}}
Query history contains the list of queries that you created in Explore. This history is stored in the Grafana database and isn't shared with other users. The retention period for a query history is two weeks. Queries older than two weeks are automatically deleted.
{{< admonition type="note" >}} Starred queries aren't subject to the two-week retention period and aren't deleted. {{< /admonition >}}
To view your query history:
The Query history pane opens at the bottom of the page, and contains the following tabs:
The Query history depicts a history of your queries for the past two weeks, unless the query is starred, which means it doesn't get deleted. For each individual query, you can:
By default, query history shows you newest queries first. Click the sort box in the upper right to change to Oldest first to older queries first. You can search your queries using keywords.
All starred queries are displayed in the Starred tab. This gives quick access to key or favorite queries without having to rewrite them.
You also have the option to switch the data source and run a starred query.
Filter query history in both the Query history and Starred tabs by data source name:
{{< admonition type="note" >}} Queries with the Mixed data source appear only when filtering for "Mixed" and not when filtering by individual data source. {{< /admonition >}}
You can also filter queries by date using the vertical slider:
Use Search queries in both the Query history and Starred tabs to search your query history and comments using keywords.
You can customize your query history in the Settings tab.
Toggle Change the default active tab from "Query history" to "Starred" to make the Starred tab the default active tab.
{{< admonition type="note" >}} Query history settings are global, and applied to both panels in split mode. {{< /admonition >}}
<!-- All queries that have been starred in the Query history tab are displayed in the Starred tab. This allows you to access your favorite queries faster and to reuse these queries without typing them from scratch. -->