--- title: "Query History in Preset" slug: "query-history" description: "This articles describes how to navigate and use the Query History screen in Preset Cloud." updated: 2023-08-08T17:27:06Z published: 2023-08-08T17:27:06Z canonical: "docs.preset.io/query-history" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.preset.io/llms.txt > Use this file to discover all available pages before exploring further. # Query History ## Overview All queries that have been run in [SQL Editor](/v1/docs/querying-and-analysis) will appear in the *Query History* screen. From there, you have access to a variety of features that enable you to manage and work with historical queries, such as: - Filter and search queries - View at-a-glance query details, such as time executed, database, schema, tables, user, rows, and schema code - Launch any historical query in the [SQL Editor](/v1/docs/querying-and-analysis) Let's look at historical queries in more detail below. --- ## Navigate to Query History In the Toolbar, select **SQL Lab** and, in the drop-down menu, select **Query History**. ![Navigate_to_Query_History](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Navigate_to_Query_History.png) --- ## Interface ![Interface_Query_History](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Interface_Query_History.png) | Column Header | Description | | --- | --- | | Time | The date & time stamp when the SQL query was executed. | | Tab name | The name of the SQL query's tab, if defined. | | Database | The database associated with the query. | | Schema | The schema associated with the query. | | Tables | The table(s) associated with the query. | | User | The Preset user who created and launched the query. | | Rows | The number of rows produced from the run query. | | SQL | The initial lines of the query's underlying SQL code — select to view the full query. | | Actions | Select to launch the query in the [SQL Editor](/v1/docs/querying-and-analysis). | ### Query Search and Filters There are a number of filters, as well as a keyword search feature, available along the horizontal bar above the content panel. These include: - **Database**: This field will be populated by all databases used in the list of queries. Simply select a database to filter by queries that are associated with your selection. - **State**: Filter by all queries, succesful queries, or failed queries. - **User**: Filter by the user who created a query. - **Time range**: Define a starting & ending date & time range and queries that ran within that span will be displayed. - **Search**: Enter a search term, select the magnifying glass icon, and queries that meet your search criteria will appear. ![Query_History_Filters_and_Search](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Query_History_Filters_and_Search.png) --- ## View SQL Code To view the underlying SQL code for a query, select the text field under the **SQL** column header: ![Query_History_View_SQL_Code](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Query_History_View_SQL_Code.png) The **Query preview** panel appears. ![Query_History_Query_Preview_Panel](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Query_History_Query_Preview_Panel.png) This panel displays the underlying SQL code for the query. By default, the query as defined by the user (**User query** tab) is displayed — to view the executed query, select the **Executed query** tab. To copy the SQL code to your system's clipboard, hover your cursor over the code and then select the copy icon. ![Query_History_Copy_Icon](https://cdn.document360.io/4749ddf8-aa05-4f3f-80e1-07a5d2d0f137/Images/Documentation/Query_History_Copy_Icon.png) To scroll through query search results, select **Previous** or **Next** as needed. To view the currently displayed SQL query in the [SQL Editor](/v1/docs/querying-and-analysis), select **Open in SQL Lab**.