Make data-driven apps (“Persistent Queries”)
Persistent Queries are essentially little applications and analytics running on the platform that generate tables and/or plot that you can add to workspaces or consume via APIs. These queries generate the content to build dashboards, so if you've reviewed our previous sections, you've seen them in action.
Here, we present a brief overview of creating Persistent Queries. As always, full details can be found in the Deephaven User Guide.
PQ Explorer
The PQ Explorer tab at the right of the Code Studio lists all the Persistent Queries available to you, as well as some status information. As shown below, the green circle indicates that DemoQuery is active, while DemoQuery1 is not. Selecting any query automatically opens its script in a new notebook panel.
Query Monitor Table
The Query Monitor table contains information about all of the Persistent Queries you are authorized to view in Deephaven. To open a Query Monitor, click the +New button at the top of the Deephaven interface, and then select New Query Monitor.
As shown below, the Query Monitor table provides information about each Persistent Query you are authorized to view, including the owner's name, the query name, whether it is enabled, its status and type, etc. The content in the table can be sorted and filtered like any other table.
When a query name is selected in the table, the panel on the right side of the Query Monitor will reveal further information about that query. Note: if you are not authorized to edit the query, only the query summary will be available.
Creating Persistent Queries
To create a new Persistent Query, select the +New button at the top of the Query Monitor.
This opens a new instance of the Persistent Query Configuration Editor. Here, we will discuss the basics of creating queries. There are of course a wide range of options and advanced settings available, and to learn more about these, please see our full documentation on Creating Persistent Queries.
Settings
In the Settings tab, you can configure the basic information for your query - it's name, the type, the appropriate server, and the memory it requires (heap size).
Permissions
The Permissions tab opens the Access Control Settings, where you can authorize users or user groups to view and/or restart the query.
Scheduling
The Scheduling tab provides options to dictate the type of schedule the query should follow, or to disable the query altogether. To adjust the query's availability, simply drag the Start Time and End Time sliders to the preferred time, or select each input directly to enter a specific value.
Script
Selecting the Script tab opens the Persistent Query Script Editor, which allows you to review the script associated with a Persistent Query or, if you have the appropriate permissions, edit an existing script.
In the following screenshot, the "Equity Volume" Persistent Query is selected on the left, and the script for that query is presented on the right: