Skip to content

Commit 9789592

Browse files
authored
tuning (#154)
1 parent 7a8232e commit 9789592

File tree

4 files changed

+22
-24
lines changed

4 files changed

+22
-24
lines changed

plugins/tpcc/4.0.0.0/analyze.sql

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
set _force_parallel_query_dop = {cpu_total};
2-
analyze table bmsql_warehouse partition(bmsql_warehouse) compute statistics for all columns size auto;
3-
analyze table bmsql_district partition(bmsql_district) compute statistics for all columns size auto;
4-
analyze table bmsql_customer partition(bmsql_customer) compute statistics for all columns size auto;
5-
analyze table bmsql_new_order partition(bmsql_new_order) compute statistics for all columns size auto;
6-
analyze table bmsql_oorder partition(bmsql_oorder) compute statistics for all columns size auto;
7-
analyze table bmsql_order_line partition(bmsql_order_line) compute statistics for all columns size auto;
8-
analyze table bmsql_stock partition(bmsql_stock) compute statistics for all columns size auto;
9-
analyze table bmsql_history partition(bmsql_history) compute statistics for all columns size auto;
10-
analyze table bmsql_config compute statistics for all columns size auto;
11-
analyze table bmsql_item compute statistics for all columns size auto;
1+
call dbms_stats.gather_table_stats('test', 'bmsql_warehouse', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
2+
call dbms_stats.gather_table_stats('test', 'bmsql_district', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
3+
call dbms_stats.gather_table_stats('test', 'bmsql_customer', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
4+
call dbms_stats.gather_table_stats('test', 'bmsql_new_order', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
5+
call dbms_stats.gather_table_stats('test', 'bmsql_oorder', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
6+
call dbms_stats.gather_table_stats('test', 'bmsql_order_line', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
7+
call dbms_stats.gather_table_stats('test', 'bmsql_stock', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
8+
call dbms_stats.gather_table_stats('test', 'bmsql_history', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
9+
call dbms_stats.gather_table_stats('test', 'bmsql_config', degree=>{cpu_total}, granularity=>'AUTO', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
10+
call dbms_stats.gather_table_stats('test', 'bmsql_item', degree=>{cpu_total}, granularity=>'AUTO', method_opt=>'FOR ALL COLUMNS SIZE AUTO');

plugins/tpch/3.1.0/run_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,10 @@ def local_execute_command(command, env=None, timeout=None):
227227
end_time = time.time()
228228
cost = end_time - start_time
229229
total_cost += cost
230-
stdio.print('[%s]: end %s, cost %.1fs' % (time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(end_time)), path, cost))
230+
stdio.print('[%s]: end %s, cost %.2fs' % (time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(end_time)), path, cost))
231231
if not ret:
232232
raise Exception(ret.stderr)
233-
stdio.print('Total Cost: %.1fs' % total_cost)
233+
stdio.print('Total Cost: %.2fs' % total_cost)
234234
return plugin_context.return_true()
235235
except KeyboardInterrupt:
236236
stdio.stop_loading('fail')

plugins/tpch/4.0.0.0/analyze.sql

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
set _force_parallel_query_dop = {cpu_total};
2-
analyze table lineitem partition(lineitem) compute statistics for all columns size auto;
3-
analyze table orders partition(orders) compute statistics for all columns size auto;
4-
analyze table partsupp partition(partsupp) compute statistics for all columns size auto;
5-
analyze table part partition(part) compute statistics for all columns size auto;
6-
analyze table customer partition(customer) compute statistics for all columns size auto;
7-
analyze table supplier partition(supplier) compute statistics for all columns size auto;
8-
analyze table nation compute statistics for all columns size auto;
9-
analyze table region compute statistics for all columns size auto;
1+
call dbms_stats.gather_table_stats('test', 'lineitem', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
2+
call dbms_stats.gather_table_stats('test', 'orders', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
3+
call dbms_stats.gather_table_stats('test', 'partsupp', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
4+
call dbms_stats.gather_table_stats('test', 'part', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
5+
call dbms_stats.gather_table_stats('test', 'customer', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
6+
call dbms_stats.gather_table_stats('test', 'supplier', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
7+
call dbms_stats.gather_table_stats('test', 'nation', degree=>{cpu_total}, granularity=>'AUTO', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
8+
call dbms_stats.gather_table_stats('test', 'region', degree=>{cpu_total}, granularity=>'AUTO', method_opt=>'FOR ALL COLUMNS SIZE AUTO');

plugins/tpch/4.0.0.0/run_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,10 @@ def local_execute_command(command, env=None, timeout=None):
243243
end_time = time.time()
244244
cost = end_time - start_time
245245
total_cost += cost
246-
stdio.print('[%s]: end %s, cost %.1fs' % (time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(end_time)), path, cost))
246+
stdio.print('[%s]: end %s, cost %.2fs' % (time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(end_time)), path, cost))
247247
if not ret:
248248
raise Exception(ret.stderr)
249-
stdio.print('Total Cost: %.1fs' % total_cost)
249+
stdio.print('Total Cost: %.2fs' % total_cost)
250250
return plugin_context.return_true()
251251
except KeyboardInterrupt:
252252
stdio.stop_loading('fail')

0 commit comments

Comments
 (0)