Skip to content

Commit

Permalink
Merge pull request #5 from velavokr/patch-3
Browse files Browse the repository at this point in the history
Fixed image refs in using-the-sql-editor.md
  • Loading branch information
krishfirebolt authored Oct 31, 2023
2 parents a753870 + d8b834e commit 56b2153
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions docs/Guides/query-data/using-the-sql-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You can launch the SQL editor for a database either from the left navigation pan

1. Choose the **>\_** icon from the left navigation pane.

![](../assets/images/work-with-our-sql-editor-select-editor-from-nav.png)
![](../../assets/images/work-with-our-sql-editor-select-editor-from-nav.png)

The editor for the database that you last worked with opens, and the database is selected from the list.

Expand All @@ -34,7 +34,7 @@ You can launch the SQL editor for a database either from the left navigation pan

* From the Databases list, hover over the **Database name** and then choose the **>\_** icon.

![](../assets/images/work-with-our-sql-editor-select-editor-from-db.png)
![](../../assets/images/work-with-our-sql-editor-select-editor-from-db.png)

## Quick tour

Expand All @@ -46,7 +46,7 @@ The SQL editor is organized into three panes.

* The right pane is an object viewer that shows you the tables, views, and indexes in your database. You must start an engine before objects are visible. You can select an object to view its attributes. For example, you can select a table from the list of tables to view columns and data types.

![](../assets/images/work-with-our-sql-editor-select-editor-quicktour.png)
![](../../assets/images/work-with-our-sql-editor-select-editor-quicktour.png)

## Editing SQL scripts

Expand All @@ -60,19 +60,19 @@ As you enter your code in a script tab, Firebolt suggests keywords and object na

You can click the keyboard icon to view available keyboard shortcuts, or you can view a full list on our [keyboard shortcuts page](keyboard-shortcuts-for-sql-editor.md). You can also select an item from the list to perform that action.

![](../assets/images/work-with-our-sql-editor-select-editor-keyboard-shortcuts.png)
![](../../assets/images/work-with-our-sql-editor-select-editor-keyboard-shortcuts.png)

### Using script templates

Script templates are available for common tasks, such as creating fact or dimension tables. Place the cursor in the editor where you want to insert code, choose the **\</>** icon, and then select a query template from the list.

![](../assets/images/work-with-our-sql-editor-select-editor-templates.png)
![](../../assets/images/work-with-our-sql-editor-select-editor-templates.png)

### Using the CREATE EXTERNAL TABLE template to import data

To create an external table, which is the first step for ingesting data into Firebolt, choose the **Import Data** button from the object pane or choose the download icon and then choose **Import data** as shown in the example below.

![](../assets/images/work-with-our-sql-editor-import-data.png)
![](../../assets/images/work-with-our-sql-editor-import-data.png)

Firebolt creates a new tab with a `CREATE EXTERNAL TABLE` statement.

Expand All @@ -93,19 +93,19 @@ Firebolt uses cookies in your client to save the state of unsaved scripts automa
**To save a script**<a name="scriptsave"></a>

1. Choose the vertical ellipses in the tab title and then select **Save script**.
![](../assets/images/work-with-our-sql-editor-save-script.png)
![](../../assets/images/work-with-our-sql-editor-save-script.png)

2. Type a new name for the script and then press ENTER.
The script appears in the **Database scripts** list and is available to you in that database until you delete it. By default, saved scripts are available only in the database where you created them. To make them available in other databases, make them global as described below.
![](../assets/images/work-with-our-sql-editor-select-editor-db-scripts-list.png)
![](../../assets/images/work-with-our-sql-editor-select-editor-db-scripts-list.png)

**To make a script global (available in other databases)**<a name="scriptglobal"></a>

* Choose the vertical ellipses next to the script in the left pane and then choose **Make script global**.
![](../assets/images/global_script.png)
![](../../assets/images/global_script.png)

Firebolt moves the script to the **Global scripts** list.
![](../assets/images/global_script_list.png)
![](../../assets/images/global_script_list.png)

**To rename a script**<a name="scriptrename"></a>

Expand All @@ -124,7 +124,7 @@ Firebolt uses cookies in your client to save the state of unsaved scripts automa
**To import a script from a file**<a name="scriptimport"></a>

1. Choose the arrow icon and then choose **Import script**.
![](../assets/images/work-with-our-sql-editor-import-script.png)
![](../../assets/images/work-with-our-sql-editor-import-script.png)

2. Browse your computer for a `.sql` file and select it, or drag and drop a file to upload it.
Firebolt creates a new tab with the contents of the script you imported.
Expand All @@ -149,25 +149,25 @@ While your script is running, its status is displayed at the top of the browser

After you run a script or query statement, more results appear below the script editor, along with statistics about query execution.

![](../assets/images/workspace_statistics.png)
![](../../assets/images/workspace_statistics.png)

When running a query, Firebolt provides several statistics to help you understand and monitor the performance. These statistics can be viewed in the SQL editor, just above the query results table. From left to right, these icons represent the following:

| Icon | Name | Description |
| :--- | :---- | :---------- |
| ![](../assets/images/Row_count.png) | **Row count** | The total number of rows returned by a query. |
| ![](../assets/images/Elapsed_time.png) | **Elapsed Time** | The total time needed to complete a query. |
| ![](../assets/images/Scanned_bytes.png) | **Scanned Bytes** | The total amount of bytes scanned to complete a query. This includes scanned memory in the engine cache as well as the F3 storage. |
| ![](../assets/images/Rows_Second.png) | **Rows / Second** | The number of rows scanned per second. |
| ![](../assets/images/Warm_data.png) | **Cached data ratio** | The percentage of data served from cache (engine SSD and RAM) rather than F3 storage. Equal to `<cached_bytes_scanned>`/`<total_bytes_scanned>`. Cached data is scanned very quickly. A high percentage indicates improved query response times. A low percentage indicates that query performance could be improved by [configuring indexes](../../Overview/using-indexes.md), changing your [warmup method](../../Overview/understanding-engine-fundamentals.md#warmup-method), or [changing the spec of your engine](../../Overview/choosing-an-engine.md) to have a bigger cache. |
| ![](../../assets/images/Row_count.png) | **Row count** | The total number of rows returned by a query. |
| ![](../../assets/images/Elapsed_time.png) | **Elapsed Time** | The total time needed to complete a query. |
| ![](../../assets/images/Scanned_bytes.png) | **Scanned Bytes** | The total amount of bytes scanned to complete a query. This includes scanned memory in the engine cache as well as the F3 storage. |
| ![](../../assets/images/Rows_Second.png) | **Rows / Second** | The number of rows scanned per second. |
| ![](../../assets/images/Warm_data.png) | **Cached data ratio** | The percentage of data served from cache (engine SSD and RAM) rather than F3 storage. Equal to `<cached_bytes_scanned>`/`<total_bytes_scanned>`. Cached data is scanned very quickly. A high percentage indicates improved query response times. A low percentage indicates that query performance could be improved by [configuring indexes](../../Overview/using-indexes.md), changing your [warmup method](../../Overview/understanding-engine-fundamentals.md#warmup-method), or [changing the spec of your engine](../../Overview/choosing-an-engine.md) to have a bigger cache. |

### Viewing query statistics with results

While viewing query results, you can choose to view a selection of prepared statistics to help you investigate data characteristics and identify anomalies more quickly.

To view query statistics, choose the expansion arrow to the left of a result table header row.

![](../assets/images/column_statistics.png)
![](../../assets/images/column_statistics.png)

Each column expands to show statistics on a new row located just below the header. The statistics shown in each cell depend on the column’s [data type](../../sql_reference/data-types.md).

Expand All @@ -182,15 +182,15 @@ Each column expands to show statistics on a new row located just below the heade

You can view additional statistics and visualizations by selecting the expand icon that appears when you mouse over the bottom right of the statistics row cell. This opens up a side panel with a dashboard of more statistics detailing the selected column.

![](../assets/images/2021-09-09_12-25-02.png)
![](../../assets/images/2021-09-09_12-25-02.png)

### Viewing multi-statement script results

When you run a script that has multiple SQL statements with result sets (`SELECT` statements), each result is shown on a separate line with statistics about statement execution. The first statement that ran is numbered 1 and at the bottom of the list.

To view the results table for a result set, choose the table icon corresponding to the numbered result set you want to view, or choose the expansion arrow next to the **Statement** and then choose **Open table** as shown in the example below.

![](../assets/images/work-with-our-sql-editor-multi-select-query-results.png)
![](../../assets/images/work-with-our-sql-editor-multi-select-query-results.png)

### Exporting results to a local hard drive

Expand All @@ -200,12 +200,12 @@ You can export up to 10,000 rows of query results to your local hard drive after

2. Choose **Export table as CSV** or **Export table as JSON**.
Firebolt downloads the file type that you chose to the default download location for your browser.
![](../assets/images/download_icon.png)
![](../../assets/images/download_icon.png)

It is possible to export the results of a single query alongside the results summary of all queries run in your script (with the statistics).

## Using dark mode

Select the toggle at the bottom of the left navigation pane to turn dark mode on and off.

![](../assets/images/dark_mode.png)
![](../../assets/images/dark_mode.png)

0 comments on commit 56b2153

Please sign in to comment.