Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions be/src/pipeline/pipeline_fragment_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,12 @@ Status PipelineFragmentContext::prepare(const doris::TPipelineFragmentParams& re
const std::vector<TScanRangeParams>& scan_ranges = find_with_default(
local_params.per_node_scan_ranges, scan_node->id(), no_scan_ranges);
scan_node->set_scan_ranges(scan_ranges);
} else {
ScanNode* scan_node = static_cast<ScanNode*>(node);
const std::vector<TScanRangeParams>& scan_ranges = find_with_default(
local_params.per_node_scan_ranges, scan_node->id(), no_scan_ranges);
scan_node->set_scan_ranges(scan_ranges);
VLOG_CRITICAL << "scan_node_Id=" << scan_node->id() << " size=" << scan_ranges.size();
}
}

Expand Down Expand Up @@ -385,6 +391,7 @@ Status PipelineFragmentContext::_build_pipelines(ExecNode* node, PipelinePtr cur
case TPlanNodeType::JDBC_SCAN_NODE:
case TPlanNodeType::ODBC_SCAN_NODE:
case TPlanNodeType::FILE_SCAN_NODE:
case TPlanNodeType::META_SCAN_NODE:
case TPlanNodeType::ES_SCAN_NODE: {
OperatorBuilderPtr operator_t =
std::make_shared<ScanOperatorBuilder>(next_operator_builder_id(), node);
Expand Down
10 changes: 10 additions & 0 deletions be/src/vec/exec/scan/new_olap_scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,23 @@ NewOlapScanner::NewOlapScanner(RuntimeState* state, NewOlapScanNode* parent, int

static std::string read_columns_to_string(TabletSchemaSPtr tablet_schema,
const std::vector<uint32_t>& read_columns) {
// avoid too long for one line,
// it is hard to display in `show profile` stmt if one line is too long.
const int col_per_line = 10;
int i = 0;
std::string read_columns_string;
read_columns_string += "[";
for (auto it = read_columns.cbegin(); it != read_columns.cend(); it++) {
if (it != read_columns.cbegin()) {
read_columns_string += ", ";
}
read_columns_string += tablet_schema->columns().at(*it).name();
if (i >= col_per_line) {
read_columns_string += "\n";
i = 0;
} else {
++i;
}
}
read_columns_string += "]";
return read_columns_string;
Expand Down
6 changes: 6 additions & 0 deletions docs/en/docs/admin-manual/query-profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ under the License.

This document focuses on introducing the **Running Profile** which recorded runtime status of Doris in query execution. Using these statistical information, we can understand the execution of frgment to become a expert of Doris's **debugging and tuning**.

You can also refer to following statements to view profile in command line:

- [SHOW QUERY PROFILE](../sql-manual/sql-reference/Show-Statements/SHOW-QUERY-PROFILE.md)
- [SHOW LOAD PROFILE](../sql-manual/sql-reference/Show-Statements/SHOW-LOAD-PROFILE.md)

## Noun Interpretation

* **FE**: Frontend, frontend node of Doris. Responsible for metadata management and request access.
Expand All @@ -39,6 +44,7 @@ This document focuses on introducing the **Running Profile** which recorded runt
## Basic concepts

FE splits the query plan into fragments and distributes them to BE for task execution. BE records the statistics of **Running State** when executing fragment. BE print the outputs statistics of fragment execution into the log. FE can also collect these statistics recorded by each fragment and print the results on FE's web page.

## Specific operation

Turn on the report switch on FE through MySQL command
Expand Down
3 changes: 3 additions & 0 deletions docs/en/docs/lakehouse/multi-catalog/hive.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,11 @@ CREATE CATALOG hive WITH RESOURCE hms_resource PROPERTIES(
```

<version since="dev"></version>

You can use the config `file.meta.cache.ttl-second` to set TTL(Time-to-Live) config of File Cache, so that the stale file info will be invalidated automatically after expiring. The unit of time is second.

You can also set file_meta_cache_ttl_second to 0 to disable file cache.Here is an example:

```sql
CREATE CATALOG hive PROPERTIES (
'type'='hms',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ grammar:
show load profile "/";

show load profile "/[queryId]"

show load profile "/[queryId]/[TaskId]"

show load profile "/[queryId]/[TaskId]/[FragmentId]/"

show load profile "/[queryId]/[TaskId]/[FragmentId]/[InstanceId]"
````

This command will list all currently saved import profiles. Each line corresponds to one import. where the QueryId column is the ID of the import job. This ID can also be viewed through the SHOW LOAD statement. We can select the QueryId corresponding to the Profile we want to see to see the specific situation
Expand Down Expand Up @@ -109,10 +115,56 @@ WaitAndFetchResultTime: N/A
+-----------------------------------+------------+
````

3. View the Instance overview of the specified subtask
3. View the plan tree of the specified subtask

```sql
show load profile "/980014623046410a-af5d36f23381017f/980014623046410a-af5d36f23381017f";

┌───────────────────────┐
│[-1: OlapTableSink] │
│Fragment: 0 │
│MaxActiveTime: 86.541ms│
└───────────────────────┘
┌───────────────────┐
│[1: VEXCHANGE_NODE]│
│Fragment: 0 │
└───────────────────┘
┌─────────────────────────┴───────┐
│ │
┌─────────────┐ ┌───────────────────────┐
│[MemoryUsage]│ │[1: VDataStreamSender] │
│Fragment: 0 │ │Fragment: 1 │
└─────────────┘ │MaxActiveTime: 34.882ms│
└───────────────────────┘
┌───────────────────────────┐
│[0: VNewOlapScanNode(tbl1)]│
│Fragment: 1 │
└───────────────────────────┘
┌─────────────────┴───────┐
│ │
┌─────────────┐ ┌───────────┐
│[MemoryUsage]│ │[VScanner] │
│Fragment: 1 │ │Fragment: 1│
└─────────────┘ └───────────┘
┌───────┴─────────┐
│ │
┌─────────────────┐ ┌─────────────┐
│[SegmentIterator]│ │[MemoryUsage]│
│Fragment: 1 │ │Fragment: 1 │
└─────────────────┘ └─────────────┘

```sql

This will show the plan tree and fragment id on it

4. View the Instance overview of the specified subtask

```sql
mysql> show load profile "/980014623046410a-af5d36f23381017f/980014623046410a-af5d36f23381017f/980014623046410a-88e260f0c43031f5"\G
mysql> show load profile "/980014623046410a-af5d36f23381017f/980014623046410a-af5d36f23381017f/1"\G
+-----------------------------------+------------------+------------+
| Instances | Host | ActiveTime |
+-----------------------------------+------------------+------------+
Expand All @@ -126,84 +178,48 @@ WaitAndFetchResultTime: N/A
4. Continue to view the detailed Profile of each operator on a specific Instance

```sql
mysql> show load profile "/10441/980014623046410a-88e260f0c43031f1/980014623046410a-88e260f0c43031f5"\G
mysql> show load profile "/980014623046410a-af5d36f23381017f/980014623046410a-af5d36f23381017f/1/980014623046410a-88e260f0c43031f5"\G

*************************** 1. row ***************************

Instance:

┌-----------------------------------------┐

│[-1: OlapTableSink] │

│(Active: 2m17s, non-child: 70.91) │

│ - Counters: │

│ - CloseWaitTime: 1m53s │

│ - ConvertBatchTime: 0ns │

│ - MaxAddBatchExecTime: 1m46s │

│ - NonBlockingSendTime: 3m11s │

│ - NumberBatchAdded: 782 │

│ - NumberNodeChannels: 1 │

│ - OpenTime: 743.822us │

│ - RowsFiltered: 0 │

│ - RowsRead: 1.599729M (1599729) │

│ - RowsReturned: 1.599729M (1599729)│

│ - SendDataTime: 11s761ms │

│ - TotalAddBatchExecTime: 1m46s │

│ - ValidateDataTime: 9s802ms │

└-----------------------------------------┘


┌-----------------------------------------------------┐

│[0: BROKER_SCAN_NODE] │

│(Active: 56s537ms, non-child: 29.06) │

│ - Counters: │

│ - BytesDecompressed: 0.00 │

│ - BytesRead: 5.77 GB │

│ - DecompressTime: 0ns │

│ - FileReadTime: 34s263ms │

│ - MaterializeTupleTime(*): 45s54ms │

│ - NumDiskAccess: 0 │

│ - PeakMemoryUsage: 33.03 MB │

│ - RowsRead: 1.599729M (1599729) │

│ - RowsReturned: 1.599729M (1599729) │

│ - RowsReturnedRate: 28.295K sec │

│ - RowsReturnedRate: 28.295K sec │
│ - TotalRawReadTime(*): 1m20s │

│ - TotalReadThroughput: 30.39858627319336 MB/sec│

│ - WaitScannerTime: 56s528ms │

└-----------------------------------------------------┘
````

Expand Down
6 changes: 5 additions & 1 deletion docs/zh-CN/docs/admin-manual/query-profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ under the License.

本文档主要介绍Doris在查询执行的统计结果。利用这些统计的信息,可以更好的帮助我们了解Doris的执行情况,并有针对性的进行相应**Debug与调优工作**。

也可以参考如下语法在命令行中查看导入和查询的 Profile:

- [SHOW QUERY PROFILE](../sql-manual/sql-reference/Show-Statements/SHOW-QUERY-PROFILE.md)
- [SHOW LOAD PROFILE](../sql-manual/sql-reference/Show-Statements/SHOW-LOAD-PROFILE.md)

## 名词解释

Expand Down Expand Up @@ -273,4 +277,4 @@ OLAP_SCAN_NODE (id=0):(Active: 1.2ms, % non-child: 0.00%)
- PeakReservation: Reservation的峰值
- PeakUnpinnedBytes: unpin的内存数据量
- PeakUsedReservation: Reservation的内存使用量
- ReservationLimit: BufferPool的Reservation的限制量
- ReservationLimit: BufferPool的Reservation的限制量
1 change: 1 addition & 0 deletions docs/zh-CN/docs/lakehouse/multi-catalog/hive.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ CREATE CATALOG hive WITH RESOURCE hms_resource PROPERTIES(
<version since="dev"></version>

创建 Catalog 时可以采用参数 `file.meta.cache.ttl-second` 来设置 File Cache 自动失效时间,也可以将该值设置为 0 来禁用 File Cache。时间单位为:秒。示例如下:

```sql
CREATE CATALOG hive PROPERTIES (
'type'='hms',
Expand Down
Loading