tencent cloud

Feedback

Detail Query

Last updated: 2024-11-20 14:19:36
    The detail query page provides in-depth retrieval and analysis of SQL stored in the database. Through SQL detail query, users can filter, sort, and aggregate SQL statements, extracting necessary data from the database based on specific needs for further processing and analysis, thereby enabling targeted database performance optimization.
    The detail query page allows users to view the SQL details list and SQL audit details, and download the SQL record list.

    Prerequisites

    Full-link analysis feature has been enabled for the instances. For detailed instructions, see Enabling End-to-End Analysis.

    Viewing SQL Details List

    1. Log in to the DBbrain Console.
    2. In the left sidebar, choose Full-link analysis > Details Inquiry.
    3. At the top of the page, select the database type, and select a node ID, instance ID, or cluster ID.
    4. Filter SQL using the following options.
    Time range: Select a time range, supporting options such as the last 1 minute, last 15 minutes, last 1 hour, or a custom time range.
    Keywords: Enter one or more keywords for fuzzy matching, selecting OR or AND.
    More fields: Click More at the top of the page to expand the available fields, and enter or select criteria in the respective fields. Setting multiple fields simultaneously is supported for precise SQL filtering.
    5. View SQL details.
    MySQL&TDSQL-C for MySQL
    TDSQL MySQL&MariaDB
    PostgreSQL

    Viewing SQL Details

    
    Field descriptions for the list are shown in the table below.
    Field
    Description
    Start Time
    The time when the SQL statement starts execution.
    SQL Type
    The type of SQL to which the executed statement belongs.
    SQL
    The executed SQL statement.
    Hover the mouse pointer over the SQL statement to display the copy and view buttons, allowing you to copy the SQL statement or view the complete SQL statement.
    Database
    The database where the SQL statement is executed.
    User
    The username initiating the SQL operation.
    Access IP
    The client IP address executing the SQL statement.
    Thread ID
    A unique identifier assigned to distinguish between different threads.
    Error Code
    Displays the corresponding error code if an error occurs while the SQL statement is executed.
    An error code of 0 indicates no error.
    Returned Rows
    The number of rows returned after the SQL statement is executed.
    Modified Rows
    The number of rows modified during an SQL update.
    Scanned Rows
    The number of rows searched in the SQL query.
    Execution Time (µs)
    The time spent to execute the SQL statement.
    CPU Duration (ns)
    The time spent by the SQL query to execute on the CPU.
    Lock Wait Time (µs)
    The time a transaction spends waiting for another transaction to release a lock.
    IO wait time (µs)
    The time a thread spends waiting for an IO operation to complete.
    Transaction Duration (µs)
    The total time from the start of the transaction until it is committed or rolled back.
    Operation
    Viewing Audit Details: Click Details. For specific instructions on viewing audit details, see Viewing Audit Details.
    Viewing Previous/Next SQL: Click Previous/Next SQL. For specific instructions on viewing previous/next SQL, see Viewing Before and After SQL. Only MySQL supports viewing previous/next SQL.
    Click
    
    in the top right corner of the SQL template list to customize the list fields, then click OK.

    Viewing Audit Details

    1. In the SQL list, click Details in the Operation column for the target SQL.
    2. On the audit details page, view audit items and audit information.
    
    Click Previous/Next SQL to view the SQL statements executed before and after this SQL statement.

    Viewing Previous/Next SQL Statements

    Note:
    Only MySQL databases support viewing previous/next SQL statements.
    1. In the SQL list, click Previous/Next SQL in the Operation column for the target SQL statement.
    2. On the Previous/Next SQL page, view the SQL statements executed before and after the selected statement.
    
    Click Details to view the audit details for the SQL statement.

    Viewing SQL Details

    
    Field descriptions for the list are shown in the table below.
    Field
    Description
    Start Time
    The time when the SQL statement starts execution.
    SQL Type
    The type of SQL to which the executed statement belongs.
    SQL
    The executed SQL statement.
    Hover the mouse pointer over the SQL statement to display the copy and view buttons, allowing you to copy the SQL statement or view the complete SQL statement.
    Tag Value
    A identifier added to SQL statements based on different business needs, allowing for the categorization and analysis of SQL statements by this identifier (tag value).
    Database
    The database where the SQL statement is executed.
    User
    The username initiating the SQL operation.
    Access IP
    The client IP address executing the SQL statement.
    Affected Rows
    The number of record rows affected in an SQL operation.
    Total Duration (µs)
    The time spent to execute the SQL statement.
    Thread ID
    A unique identifier assigned to distinguish between different threads.
    Error Code
    Displays the corresponding error code if an error occurs while the SQL statement is executed.
    An error code of 0 indicates no error.
    Error Message
    Displays the corresponding error information if an error occurs during SQL statement execution.
    Timestamp
    Timestamp.
    Operation
    Viewing Audit Details: Click Details. For specific instructions on audit details, see Viewing Audit Details.
    Viewing Previous/Next SQL: Click Previous/Next SQL. For specific instructions on viewing previous/next SQL, see Viewing Before and After SQL.
    Click
    
    in the top right corner of the SQL template list to customize the list fields, then click OK.

    Viewing Audit Details

    1. In the SQL list, click Details in the Operation column for the target SQL.
    2. On the audit details page, view audit items and audit information.
    
    Click Previous/Next SQL to view the SQL statements executed before and after this SQL statement.

    Viewing Previous/Next SQL Statements

    1. In the SQL list, click Previous/Next SQL in the Operation column for the target SQL statement.
    2. On the Previous/Next SQL page, view the SQL statements executed before and after the selected statement.
    
    Click Details to view the audit details for the SQL statement.

    Viewing SQL Details

    
    Field descriptions for the list are shown in the table below.
    Field
    Description
    Start Time
    The time when the SQL statement starts execution.
    Execution Statement
    The executed SQL statement. Hover the mouse pointer over the SQL statement to display the copy and view buttons, allowing you to copy the SQL statement or view the complete SQL statement.
    Access IP
    The client IP address executing the SQL statement.
    User
    The username initiating the SQL operation.
    SQL Type
    The type of SQL to which the executed statement belongs.
    Object type
    The object types include table, view, index, function, trigger, schema, and sequence.
    Object name
    The name of the object.
    Status Code
    When you execute an SQL command, different status codes may be returned. These status codes provide information about the execution result. Below are some common execution status codes:
    00000: Indicates that the SQL command completed successfully.
    01000: Indicates that an alarm was encountered during the execution of the SQL command.
    02000: Indicates that the SQL command did not return any data.
    03000: Indicates that the completion status of the SQL command is unknown.
    08000: Indicates that an error occurred during the connection process.
    09000: Indicates that an error occurred during the execution of the trigger.
    0A000: Indicates that an unsupported feature was used.
    Execution Time (ms)
    The time spent to execute the SQL statement.
    Session ID
    Process ID.
    Affected Rows
    The number of rows affected after the SQL statement is executed.
    Operation
    Viewing Audit Details: Click Details. For specific instructions on audit details, see Viewing Audit Details.

    Viewing Audit Details

    1. In the SQL list, click Details in the Operation column for the target SQL.
    2. On the audit details page, view audit items and audit information.
    

    Downloading SQL Record List

    1. Click in the top right corner of the SQL list. In the pop-up dialog box, click
    
    to confirm and generate the download task.
    2. Click
    
    at the top of the list to view the file download progress. When the status displays as Completed, click Copy URL in the Operation column to download the file from the new page.
    Note:
    For tasks where the file is successfully generated, the file has been stored on the corresponding device.
    The download file is available for 24 hours by default, so download it promptly.
    The maximum download limit per task is 6 million records.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support