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:

  1. SET is_report_success=true;

For versions 0.15 and later, perform the following settings:

  1. SET [GLOBAL] enable_profile=true;

grammar:

  1. show query profile "/";

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

  1. show query profile "/queryId"\G
  2. 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

    1. mysql> show query profile "/";
    2. +-----------------------------------+------+-------------------------+--------------------+-----------+---------------------+---------------------+-----------+------------+
    3. | QueryId | User | DefaultDb | SQL | QueryType | StartTime | EndTime | TotalTime | QueryState |
    4. +-----------------------------------+------+-------------------------+--------------------+-----------+---------------------+---------------------+-----------+------------+
    5. | 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 |
    6. +-----------------------------------+------+-------------------------+--------------------+-----------+---------------------+---------------------+-----------+------------+
    7. 1 row in set (0.00 sec)
  2. List the query profile of the specified queryid

    1. mysql> show query profile "/327167e0db4749a9-adce3b3d770b2bb1"\G
    2. *************************** 1. row ***************************
    3. Fragments: ┌────────────────────────┐
    4. │[-1: VDataBufferSender]
    5. Fragment: 0
    6. MaxActiveTime: 783.263us
    7. └────────────────────────┘
    8. ┌┘
    9. ┌───────────────────┐
    10. │[1: VEXCHANGE_NODE]│
    11. Fragment: 0
    12. └───────────────────┘
    13. └┐
    14. ┌────────────────────────┐
    15. │[1: VDataStreamSender]
    16. Fragment: 1
    17. MaxActiveTime: 847.612us
    18. └────────────────────────┘
    19. ┌────────────────────┐
    20. │[0: VOLAP_SCAN_NODE]│
    21. Fragment: 1
    22. └────────────────────┘
    23. ┌┘
    24. ┌─────────────┐
    25. │[OlapScanner]│
    26. Fragment: 1
    27. └─────────────┘
    28. ┌─────────────────┐
    29. │[SegmentIterator]│
    30. Fragment: 1
    31. └─────────────────┘
    32. 1 row in set (0.00 sec)
  3. Lists the instance profile of the specified fragment:

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

    1. mysql> show query profile "/327167e0db4749a9-adce3b3d770b2bb1/1/327167e0db4749a9-adce3b3d770b2bb2"\G
    2. *************************** 1. row ***************************
    3. Instance: ┌───────────────────────────────────────┐
    4. │[1: VDataStreamSender]
    5. │(Active: 36.944us, non-child: 0.20)
    6. - Counters:
    7. - BytesSent: 0.00
    8. - IgnoreRows: 0
    9. - LocalBytesSent: 20.00 B
    10. - OverallThroughput: 0.0 /sec
    11. - PeakMemoryUsage: 0.00
    12. - SerializeBatchTime: 0ns
    13. - UncompressedRowBatchSize: 0.00
    14. └───────────────────────────────────────┘
    15. ┌───────────────────────────────────────┐
    16. │[0: VOLAP_SCAN_NODE]
    17. │(Active: 563.241us, non-child: 3.00)
    18. - Counters:
    19. - BatchQueueWaitTime: 444.714us
    20. - BytesRead: 37.00 B
    21. - NumDiskAccess: 1
    22. - NumScanners: 2
    23. - PeakMemoryUsage: 320.00 KB
    24. - RowsRead: 4
    25. - RowsReturned: 4
    26. - RowsReturnedRate: 7.101K /sec
    27. - ScannerBatchWaitTime: 206.40us
    28. - ScannerSchedCount : 2
    29. - ScannerWorkerWaitTime: 34.640us
    30. - TabletCount : 2
    31. - TotalReadThroughput: 0.0 /sec
    32. └───────────────────────────────────────┘
    33. ┌─────────────────────────────────┐
    34. │[OlapScanner]
    35. │(Active: 0ns, non-child: 0.00)
    36. - Counters:
    37. - BlockConvertTime: 0ns
    38. - BlockFetchTime: 183.741us
    39. - ReaderInitTime: 180.741us
    40. - RowsDelFiltered: 0
    41. - RowsPushedCondFiltered: 0
    42. - ScanCpuTime: 388.576us
    43. - ScanTime: 0ns
    44. - ShowHintsTime_V1: 0ns
    45. └─────────────────────────────────┘
    46. ┌─────────────────────────────────────┐
    47. │[SegmentIterator]
    48. │(Active: 0ns, non-child: 0.00)
    49. - Counters:
    50. - BitmapIndexFilterTimer: 124ns
    51. - BlockLoadTime: 179.202us
    52. - BlockSeekCount: 5
    53. - BlockSeekTime: 18.792us
    54. - BlocksLoad: 4
    55. - CachedPagesNum: 2
    56. - CompressedBytesRead: 0.00
    57. - DecompressorTimer: 0ns
    58. - IOTimer: 0ns
    59. - IndexLoadTime_V1: 0ns
    60. - NumSegmentFiltered: 0
    61. - NumSegmentTotal: 2
    62. - RawRowsRead: 4
    63. - RowsBitmapIndexFiltered: 0
    64. - RowsBloomFilterFiltered: 0
    65. - RowsConditionsFiltered: 0
    66. - RowsKeyRangeFiltered: 0
    67. - RowsStatsFiltered: 0
    68. - RowsVectorPredFiltered: 0
    69. - TotalPagesNum: 2
    70. - UncompressedBytesRead: 0.00
    71. - VectorPredEvalTime: 0ns
    72. └─────────────────────────────────────┘
    73. 1 row in set (0.01 sec)

Keywords

  1. SHOW, QUERY, PROFILE

Best Practice