SQL worksheet
SQL worksheet
The query editor page provides a rich analytical interface for writing and submitting SQL queries, and also for viewing the results as your statements get completed. Performing DML, DDL, and even DCL queries is possible and our query editor supports executing multiple statements in a single run.

Managing the worksheet
ByteHouse automatically saves worksheets as drafts when you type. To create a new worksheet, click on the plus (+) sign, and give a meaningful name to the worksheet (e.g. Sales Analytics
). Then, double-click the worksheet title in the tab bar.
To open a closed worksheet, click the SQL editor menu to the left of the Data Object browser, choose one worksheet and click Edit Worksheet.

To share the worksheet, choose the share button in the upper right corner. This will open the Share Worksheet dialogue. You can choose the role to share the worksheet with.

Using the data object browser

The object browser allows users to explore all databases, schemas, tables, and views accessible by the role selected for a worksheet.
The list of databases and other objects refreshes automatically when the worksheet context changes. Users can also click the refresh button at the top of the object browser to view the object changes immediately.
The object browser can be collapsed to make more room for the SQL editor and results/history panes.
-
Double-click to insert a name into SQL editor
-
Preview table data
Using virtual warehouses
Click the “virtual warehouse” menu to select a different active warehouse for the worksheet. You can resume or suspend the selected warehouse, or resize the warehouse.

Managing queries
The query details and results displayed in the worksheet are only valid for the current user session. If you log out of the web interface and log back in, the results from your previous session won’t appear in the worksheet. However, you can use the History page to see queries that were executed.
Running queries

You can select queries to execute queries in the SQL editor in either of the following ways:
Action | Steps |
---|---|
Execute single/multiple queries | Select one or more adjacent query texts using the cursor. |
Execute all queries | Select the All Queries checkbox. |
Aborting ongoing queries
When queries begin running, the Run button changes to an Abort button. Choose this option to abort running queries.
Viewing query information

Using query history
History page allows you to examine the details of all queries executed in the past. The page displays a historical list of queries, including queries executed from SnowSQL or other SQL clients. The default information displayed for each query includes:
-
Current status of the query - waiting in the queue, running, succeeded, failed
-
SQL text of the query
-
Query ID
-
Query start and end time, as well as duration
-
Information about the query, including the number of bytes scanned, and the number of rows returned

Using query profiler
Besides query details and results, ByteHouse provides the query profile for analysing query statistics, including the individual execution components that comprise the query.
Simply go to History page and click on the desired QueryID hyperlink for the query execution corresponding to the analysis information you wish to view.

Updated 7 days ago