Skip to main content
Skip to main content

SHOW-QUERY-PROFILE

SHOW-QUERY-PROFILE​

Name​

SHOW QUERY PROFILE

Description​

This statement is used to view the tree profile information of the query operation,this function requires the user to open profile settings. Before versions 0.15, perform the following settings:

SET is_report_success=true;

For versions 0.15 and later, perform the following settings:

SET [GLOBAL] enable_profile=true;

grammar:

show query profile "/";

This command will list the profiles of all currently saved query operations.

show query profile "/queryId"\G
show query profile "/queryId/fragment_id/instance_id"\G

Get the tree profile information of the specified query ID,Return to profile simple tree.Specify fragment ID and instance ID returns the corresponding detailed profile tree.

Example​

  1. List all query Profile

    mysql> show query profile "/";
    +-----------------------------------+------+-------------------------+--------------------+-----------+---------------------+---------------------+-----------+------------+
    | QueryId | User | DefaultDb | SQL | QueryType | StartTime | EndTime | TotalTime | QueryState |
    +-----------------------------------+------+-------------------------+--------------------+-----------+---------------------+---------------------+-----------+------------+
    | 327167e0db4749a9-adce3b3d770b2bb1 | root | default_cluster:test_db | select * from test | Query | 2022-08-09 10:50:09 | 2022-08-09 10:50:09 | 19ms | EOF |
    +-----------------------------------+------+-------------------------+--------------------+-----------+---------------------+---------------------+-----------+------------+
    1 row in set (0.00 sec)
  2. List the query profile of the specified queryid

    mysql> show query profile "/327167e0db4749a9-adce3b3d770b2bb1"\G
    *************************** 1. row ***************************
    Fragments: β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚[-1: VDataBufferSender] β”‚
    β”‚Fragment: 0 β”‚
    β”‚MaxActiveTime: 783.263usβ”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    β”Œβ”˜
    β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚[1: VEXCHANGE_NODE]β”‚
    β”‚Fragment: 0 β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    └┐
    β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚[1: VDataStreamSender] β”‚
    β”‚Fragment: 1 β”‚
    β”‚MaxActiveTime: 847.612usβ”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    β”‚
    β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚[0: VOLAP_SCAN_NODE]β”‚
    β”‚Fragment: 1 β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    β”Œβ”˜
    β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚[OlapScanner]β”‚
    β”‚Fragment: 1 β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    β”‚
    β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚[SegmentIterator]β”‚
    β”‚Fragment: 1 β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    1 row in set (0.00 sec)
  3. Lists the instance profile of the specified fragment:

    mysql> show query profile "/327167e0db4749a9-adce3b3d770b2bb1/1/"\G
    *************************** 1. row ***************************
    Instances: 327167e0db4749a9-adce3b3d770b2bb2
    Host: 172.26.0.1:9111
    ActiveTime: 847.612us
    1 row in set (0.01 sec)
  4. Continue to view the detailed profile of each operator on a specific instance:

    mysql> show query profile "/327167e0db4749a9-adce3b3d770b2bb1/1/327167e0db4749a9-adce3b3d770b2bb2"\G
    *************************** 1. row ***************************
    Instance: β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚[1: VDataStreamSender] β”‚
    β”‚(Active: 36.944us, non-child: 0.20) β”‚
    β”‚ - Counters: β”‚
    β”‚ - BytesSent: 0.00 β”‚
    β”‚ - IgnoreRows: 0 β”‚
    β”‚ - LocalBytesSent: 20.00 B β”‚
    β”‚ - OverallThroughput: 0.0 /sec β”‚
    β”‚ - PeakMemoryUsage: 0.00 β”‚
    β”‚ - SerializeBatchTime: 0ns β”‚
    β”‚ - UncompressedRowBatchSize: 0.00 β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    β”‚
    β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚[0: VOLAP_SCAN_NODE] β”‚
    β”‚(Active: 563.241us, non-child: 3.00) β”‚
    β”‚ - Counters: β”‚
    β”‚ - BatchQueueWaitTime: 444.714us β”‚
    β”‚ - BytesRead: 37.00 B β”‚
    β”‚ - NumDiskAccess: 1 β”‚
    β”‚ - NumScanners: 2 β”‚
    β”‚ - PeakMemoryUsage: 320.00 KB β”‚
    β”‚ - RowsRead: 4 β”‚
    β”‚ - RowsReturned: 4 β”‚
    β”‚ - RowsReturnedRate: 7.101K /sec β”‚
    β”‚ - ScannerBatchWaitTime: 206.40us β”‚
    β”‚ - ScannerSchedCount : 2 β”‚
    β”‚ - ScannerWorkerWaitTime: 34.640usβ”‚
    β”‚ - TabletCount : 2 β”‚
    β”‚ - TotalReadThroughput: 0.0 /sec β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    β”‚
    β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚[OlapScanner] β”‚
    β”‚(Active: 0ns, non-child: 0.00) β”‚
    β”‚ - Counters: β”‚
    β”‚ - BlockConvertTime: 0ns β”‚
    β”‚ - BlockFetchTime: 183.741usβ”‚
    β”‚ - ReaderInitTime: 180.741usβ”‚
    β”‚ - RowsDelFiltered: 0 β”‚
    β”‚ - RowsPushedCondFiltered: 0β”‚
    β”‚ - ScanCpuTime: 388.576us β”‚
    β”‚ - ScanTime: 0ns β”‚
    β”‚ - ShowHintsTime_V1: 0ns β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    β”‚
    β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚[SegmentIterator] β”‚
    β”‚(Active: 0ns, non-child: 0.00) β”‚
    β”‚ - Counters: β”‚
    β”‚ - BitmapIndexFilterTimer: 124nsβ”‚
    β”‚ - BlockLoadTime: 179.202us β”‚
    β”‚ - BlockSeekCount: 5 β”‚
    β”‚ - BlockSeekTime: 18.792us β”‚
    β”‚ - BlocksLoad: 4 β”‚
    β”‚ - CachedPagesNum: 2 β”‚
    β”‚ - CompressedBytesRead: 0.00 β”‚
    β”‚ - DecompressorTimer: 0ns β”‚
    β”‚ - IOTimer: 0ns β”‚
    β”‚ - IndexLoadTime_V1: 0ns β”‚
    β”‚ - NumSegmentFiltered: 0 β”‚
    β”‚ - NumSegmentTotal: 2 β”‚
    β”‚ - RawRowsRead: 4 β”‚
    β”‚ - RowsBitmapIndexFiltered: 0 β”‚
    β”‚ - RowsBloomFilterFiltered: 0 β”‚
    β”‚ - RowsConditionsFiltered: 0 β”‚
    β”‚ - RowsKeyRangeFiltered: 0 β”‚
    β”‚ - RowsStatsFiltered: 0 β”‚
    β”‚ - RowsVectorPredFiltered: 0 β”‚
    β”‚ - TotalPagesNum: 2 β”‚
    β”‚ - UncompressedBytesRead: 0.00 β”‚
    β”‚ - VectorPredEvalTime: 0ns β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

    1 row in set (0.01 sec)

Keywords​

SHOW, QUERY, PROFILE

Best Practice​