Skip to content

Commit 1f1b5ce

Browse files
committed
Add some figures in the articles
1 parent 60ac1ba commit 1f1b5ce

File tree

34 files changed

+39
-571
lines changed

34 files changed

+39
-571
lines changed

docs/blogs/tech/parallel-execution-I.md

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
slug: parallel-execution-I
33
title: 'Mastering Parallel Execution in OceanBase Database: Part 1 - Introduction'
44
---
5+
# Mastering Parallel Execution in OceanBase Database: Part 1 - Introduction
56

67
> Message from the Author:
78
>    This is a long-expected systematic guide on parallel execution (PX).
@@ -162,52 +163,11 @@ As shown in the following figure:
162163

163164

164165
Here is a sample query:
166+
![1](/img/blogs/tech/parallel-execution-I/1.png)
165167

166-
create table game (round int primary key, team varchar(10), score int)
167-
partition by hash(round) partitions 3;
168-
169-
insert into game values (1, "CN", 4), (2, "CN", 5), (3, "JP", 3);
170-
insert into game values (4, "CN", 4), (5, "US", 4), (6, "JP", 4);
171-
172-
select /*+ parallel(3) */ team, sum(score) total from game group by team;
173168

174169
The execution plan for the query statement is as follows:
175-
176-
OceanBase(admin@test)>explain select /*+ parallel(3) */ team, sum(score) total from game group by team;
177-
+---------------------------------------------------------------------------------------------------------+
178-
| Query Plan |
179-
+---------------------------------------------------------------------------------------------------------+
180-
| ================================================================= |
181-
| |ID|OPERATOR |NAME |EST.ROWS|EST.TIME(us)| |
182-
| ----------------------------------------------------------------- |
183-
| |0 |PX COORDINATOR | |1 |4 | |
184-
| |1 | EXCHANGE OUT DISTR |:EX10001|1 |4 | |
185-
| |2 | HASH GROUP BY | |1 |4 | |
186-
| |3 | EXCHANGE IN DISTR | |3 |3 | |
187-
| |4 | EXCHANGE OUT DISTR (HASH)|:EX10000|3 |3 | |
188-
| |5 | HASH GROUP BY | |3 |2 | |
189-
| |6 | PX BLOCK ITERATOR | |1 |2 | |
190-
| |7 | TABLE SCAN |game |1 |2 | |
191-
| ================================================================= |
192-
| Outputs & filters: |
193-
| ------------------------------------- |
194-
| 0 - output([INTERNAL_FUNCTION(game.team, T_FUN_SUM(T_FUN_SUM(game.score)))]), filter(nil), rowset=256 |
195-
| 1 - output([INTERNAL_FUNCTION(game.team, T_FUN_SUM(T_FUN_SUM(game.score)))]), filter(nil), rowset=256 |
196-
| dop=3 |
197-
| 2 - output([game.team], [T_FUN_SUM(T_FUN_SUM(game.score))]), filter(nil), rowset=256 |
198-
| group([game.team]), agg_func([T_FUN_SUM(T_FUN_SUM(game.score))]) |
199-
| 3 - output([game.team], [T_FUN_SUM(game.score)]), filter(nil), rowset=256 |
200-
| 4 - output([game.team], [T_FUN_SUM(game.score)]), filter(nil), rowset=256 |
201-
| (#keys=1, [game.team]), dop=3 |
202-
| 5 - output([game.team], [T_FUN_SUM(game.score)]), filter(nil), rowset=256 |
203-
| group([game.team]), agg_func([T_FUN_SUM(game.score)]) |
204-
| 6 - output([game.team], [game.score]), filter(nil), rowset=256 |
205-
| 7 - output([game.team], [game.score]), filter(nil), rowset=256 |
206-
| access([game.team], [game.score]), partitions(p[0-2]) |
207-
| is_index_back=false, is_global_index=false, |
208-
| range_key([game.round]), range(MIN ; MAX)always true |
209-
+---------------------------------------------------------------------------------------------------------+
210-
29 rows in set (0.003 sec)
170+
![2](/img/blogs/tech/parallel-execution-I/2.png)
211171

212172
The execution plan of the `SELECT` statement first performs a full-table scan on the `game` table to group the data by team, and then calculates the total score of each team. The following figure demonstrates the query execution process.
213173

0 commit comments

Comments
 (0)