Help Center/ Data Warehouse Service/ User Guide/ Connecting to a DWS Cluster/ Using a Visualization Tool to Connect to a DWS Cluster/ Using the SQL Editor to Connect to a DWS Cluster/ Diagnosing SQL Execution and Developing Scripts
Updated on 2026-09-15 GMT+08:00
Diagnosing SQL Execution and Developing Scripts
This section describes how to perform operations on SQL statements and scripts, including Submitting a Non-Query SQL Task, Diagnosing Query SQL Statements as Planned, Creating a Directory, and Creating a Script.
Submitting a Non-Query SQL Task
- Log in to the DWS console.
- In the navigation pane on the left, choose Data > SQL Editor.
- Click Data Sources, log in to the data source for which you want to submit the SQL task, and select the corresponding database and schema.
- Enter a non-query SQL statement in the text box and click Submit SQL task to submit the selected SQL statement to the background task for execution. A maximum of 100 non-query SQL statements can be submitted at a time. A maximum of five SQL tasks can be executed by a user. Figure 1 Submitting a SQL task
- Choose Common Functions > SQL task list in the upper right corner of the page to view the executed SQL tasks.
- Click Details in the Operation column to view the execution status of each SQL statement. Figure 2 Viewing SQL task details
Diagnosing Query SQL Statements as Planned
- Log in to the DWS console.
- In the navigation pane on the left, choose Data > SQL Editor.
- Click Data Sources, log in to the data source for which you need to enter SQL statements, and select the corresponding database and schema.
- Enter a query SQL statement in the text box and click Planned diagnostics. You can select EXPLAIN or PERFORMANCE. Only one query SQL statement can be diagnosed at a time. If you enter multiple query SQL statements, the first SQL statement is diagnosed by default. If you select PERFORMANCE, the entered SQL statement is executed and the result is returned. Exercise caution when selecting this option to avoid affecting production data. Figure 3 Selecting PERFORMANCE
- Click OK. The Planned diagnostics page is displayed. You can view the SQL statement diagnosis result and plan diagnosis visualization result.
- Click SQL diagnostics to view the SQL statement formatting and diagnosis items. Figure 4 Viewing SQL statement diagnosis results
- Click Planned diagnostics to display the plan tree node and plan diagnosis result of the SQL statement. Figure 5 Viewing SQL plan diagnosis results
- Click SQL diagnostics to view the SQL statement formatting and diagnosis items.
Creating a Directory
- Log in to the DWS console.
- In the navigation pane on the left, choose Data > SQL Editor.
- Click the Scripts tab and then Create Directory. You can create a maximum of 10 directories.
- Save to Directory: Select a parent directory from the drop-down list box. If this parameter is left blank, a level-1 directory is created by default.
- Directory Name: Set the directory name. The value can contain only letters, digits, and underscores (_).
Figure 6 Creating a directory
- Confirm the information and click OK.
Creating a Script
- Log in to the DWS console.
- In the navigation pane on the left, choose Data > SQL Editor.
- Click the Scripts tab and then Create Script.
- Save to Directory: Select the new directory from the drop-down list box. This parameter is optional.
- Script Name: Set the script name. Only letters, digits, and underscores (_) are supported.
- OBS Bucket: Name of the OBS bucket for storing script files. If no OBS bucket is available, click Create OBS Bucket to access the OBS console and create one. For details, "Managing Buckets" > "Creating a Bucket" in Object Storage Service Console Operation Guide.
- Path: user-defined directory for storing script files on OBS. Multi-level directories can be separated by slashes (/). Enter 1 to 50 characters, which cannot start with a slash (/). If you do not set this parameter, the system automatically adds a path by default.
Figure 7 Creating a script
What is your overall rating for this page?
0
1
2
3
4
5
6
7
8
9
10
Very dissatisfiedVery satisfied
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot