Use SQL Editor

Updated at: 2025-03-21 10:09

SQL Editor is a tool that allows you to write, execute, and manage SQL statements in a visualized manner. You can manage and use databases with ease by using SQL Editor. This improves work efficiency and the accuracy of data processing. This topic describes how to use the SQL Editor tool of ApsaraDB for SelectDB.

Prerequisites

  • A SelectDB instance is created. For more information, see Create an instance.

  • The version of the instance is 3.0.7 or later.

Procedure

  1. Log on to the SelectDB console.

  2. In the top navigation bar, select the region in which the instance that you want to manage resides.

  3. In the left-side navigation pane, click Instances. On the Instances page, find the instance and click its ID to go to the Instance Details page.

  4. Click Data Development and Management in the upper-right corner.

    Note

    If you use the tools of Data Development and Management for the first time, a message appears and prompts you to add the public IP address of your machine to the IP address whitelist named webui_whitelist of the instance. Read the message and click OK.

  5. Select SQL Editor from the drop-down list.

    Note
    • If you use SQL Editor for the first time and have not logged on to the WebUI system, the WebUI logon page appears.

      • You can use the admin account to log on to the WebUI system.

      • If you do not know or forget the password of the admin account, you can reset the password. For more information, see Reset the password of an account.

  6. On the SQL Editor page, perform the following operations based on your business requirements:

    • Execute SQL statements:

      1. On the right side of the page, select the database on which you want to execute SQL statements from the second drop-down list in the upper part.

      2. Select the cluster on which you want to execute SQL statements from the third drop-down list. Enter SQL statements in the editor. For more information about the syntax of SQL statements, see SQL reference.

      3. Click Run (Limit 1000).

    • View execution records: In the left-side pane, click the Query History tab. In the search box, enter the SQL statement that you want to view. Click the SQL statement in the search results. The execution plan page appears. You can perform the following operations on this page:

    • Important

      Before you use this feature, you must take note of the following items:

      • The logon account must be admin.

      • If your instance runs SelectDB Core 4.0 or later, you can use the feature to view a profile online and download the profile. If your instance runs SelectDB Core 3.0, you can use the feature only to download the profile.

      • View profile information online and analyze the execution of the SQL statement.

      • Download the profile.

        Note

        By default, the query profile feature is enabled for all queries initiated on the SQL Editor page. This may slightly affect the performance of a single query.

    • View saved SQL statements: In the left-side pane, click the Saved Sessions tab. In the search box, enter the information about the session that you want to view. Then, view the saved SQL statements of the session.

    • View and use SQL templates for common benchmark tests: In the left-side pane, click the Test Queries tab. In the search box, enter the SQL template that you want to query. Then, view and use the SQL template.

Related API operations

ResetAccountPassword

DescribeSecurityIPList

ModifySecurityIPList

References

Create an instance

Reset the password of an account

Configure an IP address whitelist

SQL reference

  • On this page (1)
  • Prerequisites
  • Procedure
  • Related API operations
  • References
Feedback
phone Contact Us

Chat now with Alibaba Cloud Customer Service to assist you in finding the right products and services to meet your needs.

alicare alicarealicarealicare