Add example to show how to enable parallel query.
obclient [tpch]> explain select /*+ PARALLEL(8) */ count(*) from lineitem;
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Query Plan |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ==================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
--------------------------------------------------
|0 |SCALAR GROUP BY | |1 |7 |
|1 | PX COORDINATOR | |8 |7 |
|2 | EXCHANGE OUT DISTR |:EX10000|8 |6 |
|3 | MERGE GROUP BY | |8 |6 |
|4 | PX BLOCK ITERATOR| |1 |6 |
|5 | TABLE SCAN |lineitem|1 |6 |
==================================================
Outputs & filters:
-------------------------------------
0 - output([T_FUN_COUNT_SUM(T_FUN_COUNT_SUM(T_FUN_COUNT(*)))]), filter(nil), rowset=256,
group(nil), agg_func([T_FUN_COUNT_SUM(T_FUN_COUNT_SUM(T_FUN_COUNT(*)))])
1 - output([T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil), rowset=256
2 - output([T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil), rowset=256, dop=8
3 - output([T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil), rowset=256,
group(nil), agg_func([T_FUN_COUNT_SUM(T_FUN_COUNT(*))])
4 - output([T_FUN_COUNT(*)]), filter(nil), rowset=256
5 - output([T_FUN_COUNT(*)]), filter(nil), rowset=256,
access(nil), partitions(p[0-23])
|
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.004 sec)
obclient [tpch]> set _force_parallel_query_dop = 3;
Query OK, 0 rows affected (0.001 sec)
obclient [tpch]> explain select count(*) from lineitem;
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Query Plan |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ==================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
--------------------------------------------------
|0 |SCALAR GROUP BY | |1 |15 |
|1 | PX COORDINATOR | |3 |15 |
|2 | EXCHANGE OUT DISTR |:EX10000|3 |14 |
|3 | MERGE GROUP BY | |3 |14 |
|4 | PX BLOCK ITERATOR| |1 |14 |
|5 | TABLE SCAN |lineitem|1 |14 |
==================================================
Outputs & filters:
-------------------------------------
0 - output([T_FUN_COUNT_SUM(T_FUN_COUNT_SUM(T_FUN_COUNT(*)))]), filter(nil), rowset=256,
group(nil), agg_func([T_FUN_COUNT_SUM(T_FUN_COUNT_SUM(T_FUN_COUNT(*)))])
1 - output([T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil), rowset=256
2 - output([T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil), rowset=256, dop=3
3 - output([T_FUN_COUNT_SUM(T_FUN_COUNT(*))]), filter(nil), rowset=256,
group(nil), agg_func([T_FUN_COUNT_SUM(T_FUN_COUNT(*))])
4 - output([T_FUN_COUNT(*)]), filter(nil), rowset=256
5 - output([T_FUN_COUNT(*)]), filter(nil), rowset=256,
access(nil), partitions(p[0-23])
|
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.003 sec)
obclient [tpch]> create table t1(a int, b int ) parallel 3;
Query OK, 0 rows affected (0.136 sec)
obclient [tpch]> explain select * from t1;
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Query Plan |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
------------------------------------------------
|0 |PX COORDINATOR | |1 |2 |
|1 | EXCHANGE OUT DISTR|:EX10000|1 |1 |
|2 | PX BLOCK ITERATOR| |1 |1 |
|3 | TABLE SCAN |t1 |1 |1 |
================================================
Outputs & filters:
-------------------------------------
0 - output([INTERNAL_FUNCTION(t1.a, t1.b)]), filter(nil), rowset=256
1 - output([INTERNAL_FUNCTION(t1.a, t1.b)]), filter(nil), rowset=256, dop=3
2 - output([t1.a], [t1.b]), filter(nil), rowset=256
3 - output([t1.a], [t1.b]), filter(nil), rowset=256,
access([t1.a], [t1.b]), partitions(p0)
|
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.098 sec)
obclient [tpch]> ALTER SESSION FORCE PARALLEL QUERY PARALLEL 3;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'SESSION FORCE PARALLEL QUERY PARALLEL 3' at line 1
ALTER SESSION FORCE PARALLEL DML PARALLEL 3;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'SESSION FORCE PARALLEL DML PARALLEL 3' at line 1