All Products
Search
Document Center

ApsaraDB for SelectDB:SelectDB AI Assistant

Last Updated:Jun 02, 2026

SelectDB AI Assistant is an LLM-powered intelligent O&M tool that provides intelligent Q&A and slow query analysis. Use natural language to resolve product questions, identify performance bottlenecks, and get optimization recommendations.

Note

SelectDB AI Assistant is in free public preview. All capabilities are free of charge during the preview. Billing after the preview period will be announced separately.

Core capabilities

Intelligent Q&A

Powered by Alibaba Cloud documentation and the SelectDB expert knowledge base, the assistant answers natural language questions and labels the tool used (for example, search_docs) for answer traceability.

Typical use cases:

  • Product inquiries: Learn about SelectDB architecture, version differences, specifications, billing, and other product information.

  • Syntax and parameter lookup: Look up the meaning, defaults, and examples for commands such as Stream Load, Routine Load, INSERT, and SELECT.

  • Best practice retrieval: Get implementation guidance for table design, partitioning and bucketing, index selection, data ingestion, and query optimization.

  • Troubleshooting assistance: Diagnose common problems such as connection timeouts, ingestion failures, slow queries, and out-of-memory errors and receive recommended remediation steps.

  • Operation walkthroughs: Learn how to create instances, configure IP allowlists, connect to a database, enable internet access, and configure monitoring and alerts.

Slow query analysis

The assistant aggregates the slow query audit log of a specified instance to surface long-running queries and recommend optimizations. Each answer cites the tool used (for example, describe-slow-query-stats).

Analysis dimensions:

Dimension

Description

Slow query count

Counts the queries whose execution time exceeded the threshold during the selected time range. This indicates the overall slow query burden on the instance.

Total query count

Counts every query recorded in the audit log. Used to compute the slow query percentage.

Active user count

Counts the distinct accounts that issued slow queries, which helps you determine whether the issue is caused by a single user or is widespread.

Latency percentiles

Reports P50, P90, and P99 latencies to surface long-tail queries and quantify performance fluctuations.

Adjustable parameters:

  • Analysis time range: Defaults to the last 1 hour. Specify other ranges in natural language, such as "last 3 hours", "last 24 hours", or an explicit start and end time. A single request should not span more than 24 hours.

  • Slow query threshold: Defaults to 5,000 ms. Specify a lower value (for example, 1,000 ms) to capture subsecond slow queries. The assistant re-reads the audit log with the new threshold.

Query profile interpretation

Share a specific slow query's QueryId with the assistant to get an operator-by-operator breakdown of execution time, scanned rows, and memory consumption. This helps determine whether the bottleneck is in Scan, Join, Aggregation, or data transfer.

Profile collection is disabled by default. Enable it before executing the query you want to analyze:

  1. Connect to the SelectDB instance with a MySQL client and run the following command to check whether profile collection is enabled in the current session:

    SHOW VARIABLES LIKE 'enable_profile';
    

    true indicates that profile collection is enabled. false indicates that it is not.

  2. If profile collection is not enabled, run the following command in the same session to enable it:

    SET enable_profile = true;
    
    Note: enable_profile is a session-level variable that applies only to the current connection. Run the command again after reconnecting. Query Profile.
  3. In the same session, run the query that you want to analyze and wait for it to finish.

  4. Log on to the console, go to the Query Audit page, locate the query you just ran, and copy its QueryId. Audit queries.

  5. Paste the QueryId into the AI Assistant input box. For example, Analyze the profile for QueryId xxx. The assistant calls the DescribeProfile API to retrieve and interpret the profile.

Open the AI Assistant

  1. Log on to the ApsaraDB for SelectDB console.

  2. In the left-side navigation pane, click AI Assistant.

  3. On first use, read the terms of use dialog and click Confirm to enter the conversation page.

Use the AI Assistant

Ask a question

  1. In the input box at the bottom of the AI Assistant page, enter your question. For example, What parameters does Stream Load support?

  2. (Optional) To target a specific instance, type @ in the input box and select the instance from the drop-down list. The list shows all SelectDB instances under the current account across all regions, in the format instance ID | region | product.

  3. Click Send and wait for the assistant to respond.

  4. Below each answer, you can perform the following actions:

    • Copy: Copy the entire answer to the clipboard.

    • Download: Save the answer to a local file for archiving or sharing.

    • Thumbs up / Thumbs down: Rate the quality of the answer. Your feedback contributes to ongoing model improvements.

Analyze slow queries on an instance

  1. Type @ in the input box and select the target instance.

  2. Phrase the slow query request. Provide the following information for more accurate results:

    • Time range: For example, "last 30 minutes", "last 24 hours", or an explicit start and end time.

    • Slow query threshold: For example, "lower the threshold to 1,000 ms".

    • Focus dimension: For example, "group by user" or "list the queries with the highest P99 latency".

    Example request: Analyze the slow queries in the last hour, set the threshold to 1,000 ms, and list the five queries with the highest latency.

  3. Click Send. The assistant calls the describe-slow-query-stats tool to read the audit log and produce an analysis. A typical report covers the slow query count, total query count, active user count, latency percentiles, and optimization suggestions.

  4. For a deeper look at a specific slow query, share its QueryId in the next turn. The assistant fetches the query profile and walks through the time distribution.

Manage sessions

The AI Assistant organizes conversations into sessions for easy reference.

  • New session: Click New session above the session list to start an independent context. Use separate sessions for different topics or instances.

  • Switch sessions: Click any item in the session list to resume that conversation.

  • Collapse / expand the sidebar: Click Toggle Sidebar to hide or show the session list and free up space for the conversation area.

Limitations

Item

Description

Service status

Free public preview. Capabilities iterate continuously, and short-term unavailability may occur. Do not use the assistant as a hard dependency for production workflows.

Access permissions

RAM users must have the corresponding permissions on the SelectDB instance. The assistant inherits the current user's RAM permissions and can analyze only authorized instances.

Slow query data prerequisite

Slow query analysis depends on the SQL audit log. If the audit log is disabled or does not cover the requested time range, results may be empty.

Time range per request

A single slow query request should not span more than 24 hours.

Change operations

The assistant never executes instance changes. Perform all parameter changes, scaling, and backup and restore operations yourself in the console.

Best practices

  • Include context in your question: instance ID (selected with @), time of issue, and error messages or symptoms.

  • For complex O&M issues, iterate through symptom -> hypothesis -> investigation step across multiple turns to converge on the root cause.

  • Test any configuration change or SQL snippet on a non-production instance before applying to production.

  • Use Thumbs up or Thumbs down to rate answers. Your feedback directly influences model improvements.

Disclaimer

  • The responses produced by SelectDB AI Assistant are generated by AI. They are provided for reference only, are not guaranteed to be fully accurate, and do not represent the position or commitment of Alibaba Cloud.

  • You are responsible for the decisions you make and the operations you perform based on the assistant's output.

  • To deliver intelligent O&M capabilities, the service collects basic information, audit logs, monitoring metrics, and key events of the selected instance. This data is used only for the current conversation and is not reused for other purposes.

FAQ

Does SelectDB AI Assistant change my instance configuration automatically?

No. The assistant only provides analysis, configuration examples, and operation walkthroughs. Every operation that involves instance configuration, parameter changes, or data changes must be performed manually by you in the console or with a client.

Why does slow query analysis return 0?

Common causes: no queries ran during the selected range, no query exceeded the 5,000 ms default threshold, or the SQL audit log is disabled. Confirm the instance is receiving traffic and the audit log is enabled, then lower the threshold (for example, to 1,000 ms) if needed.

Does the assistant support cross-region instance analysis?

Yes. The instance picker triggered by @ lists every SelectDB instance under the current account across all regions. You can analyze an instance from another region without leaving the current AI Assistant page.

How can I improve the accuracy of the answers?

Include the instance ID, time range, symptom, and troubleshooting steps you have already tried. Select the target instance with @ to give the assistant instance context for more targeted responses.