Query History
  • 08 Aug 2023
  • 2 Minutes to read
  • Dark
    Light

Query History

  • Dark
    Light

Article Summary

Overview

All queries that have been run in SQL Editor 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

Let's look at historical queries in more detail below.


In the Toolbar, select SQL Lab and, in the drop-down menu, select Query History.

Navigate_to_Query_History


Interface

Interface_Query_History

Column HeaderDescription
TimeThe date & time stamp when the SQL query was executed.
Tab nameThe name of the SQL query's tab, if defined.
DatabaseThe database associated with the query.
SchemaThe schema associated with the query.
TablesThe table(s) associated with the query.
UserThe Preset user who created and launched the query.
RowsThe number of rows produced from the run query.
SQLThe initial lines of the query's underlying SQL code — select to view the full query.
ActionsSelect to launch the query in the SQL Editor.

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


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

The Query preview panel appears.

Query_History_Query_Preview_Panel

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

To scroll through query search results, select Previous or Next as needed.

To view the currently displayed SQL query in the SQL Editor, select Open in SQL Lab.


Was this article helpful?