Skip to content

Commit

Permalink
tuning (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
frf12 authored Dec 14, 2022
1 parent 7a8232e commit 9789592
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 24 deletions.
21 changes: 10 additions & 11 deletions plugins/tpcc/4.0.0.0/analyze.sql
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
set _force_parallel_query_dop = {cpu_total};
analyze table bmsql_warehouse partition(bmsql_warehouse) compute statistics for all columns size auto;
analyze table bmsql_district partition(bmsql_district) compute statistics for all columns size auto;
analyze table bmsql_customer partition(bmsql_customer) compute statistics for all columns size auto;
analyze table bmsql_new_order partition(bmsql_new_order) compute statistics for all columns size auto;
analyze table bmsql_oorder partition(bmsql_oorder) compute statistics for all columns size auto;
analyze table bmsql_order_line partition(bmsql_order_line) compute statistics for all columns size auto;
analyze table bmsql_stock partition(bmsql_stock) compute statistics for all columns size auto;
analyze table bmsql_history partition(bmsql_history) compute statistics for all columns size auto;
analyze table bmsql_config compute statistics for all columns size auto;
analyze table bmsql_item compute statistics for all columns size auto;
call dbms_stats.gather_table_stats('test', 'bmsql_warehouse', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
call dbms_stats.gather_table_stats('test', 'bmsql_district', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
call dbms_stats.gather_table_stats('test', 'bmsql_customer', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
call dbms_stats.gather_table_stats('test', 'bmsql_new_order', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
call dbms_stats.gather_table_stats('test', 'bmsql_oorder', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
call dbms_stats.gather_table_stats('test', 'bmsql_order_line', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
call dbms_stats.gather_table_stats('test', 'bmsql_stock', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
call dbms_stats.gather_table_stats('test', 'bmsql_history', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
call dbms_stats.gather_table_stats('test', 'bmsql_config', degree=>{cpu_total}, granularity=>'AUTO', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
call dbms_stats.gather_table_stats('test', 'bmsql_item', degree=>{cpu_total}, granularity=>'AUTO', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
4 changes: 2 additions & 2 deletions plugins/tpch/3.1.0/run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,10 @@ def local_execute_command(command, env=None, timeout=None):
end_time = time.time()
cost = end_time - start_time
total_cost += cost
stdio.print('[%s]: end %s, cost %.1fs' % (time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(end_time)), path, cost))
stdio.print('[%s]: end %s, cost %.2fs' % (time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(end_time)), path, cost))
if not ret:
raise Exception(ret.stderr)
stdio.print('Total Cost: %.1fs' % total_cost)
stdio.print('Total Cost: %.2fs' % total_cost)
return plugin_context.return_true()
except KeyboardInterrupt:
stdio.stop_loading('fail')
Expand Down
17 changes: 8 additions & 9 deletions plugins/tpch/4.0.0.0/analyze.sql
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
set _force_parallel_query_dop = {cpu_total};
analyze table lineitem partition(lineitem) compute statistics for all columns size auto;
analyze table orders partition(orders) compute statistics for all columns size auto;
analyze table partsupp partition(partsupp) compute statistics for all columns size auto;
analyze table part partition(part) compute statistics for all columns size auto;
analyze table customer partition(customer) compute statistics for all columns size auto;
analyze table supplier partition(supplier) compute statistics for all columns size auto;
analyze table nation compute statistics for all columns size auto;
analyze table region compute statistics for all columns size auto;
call dbms_stats.gather_table_stats('test', 'lineitem', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
call dbms_stats.gather_table_stats('test', 'orders', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
call dbms_stats.gather_table_stats('test', 'partsupp', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
call dbms_stats.gather_table_stats('test', 'part', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
call dbms_stats.gather_table_stats('test', 'customer', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
call dbms_stats.gather_table_stats('test', 'supplier', degree=>{cpu_total}, granularity=>'GLOBAL', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
call dbms_stats.gather_table_stats('test', 'nation', degree=>{cpu_total}, granularity=>'AUTO', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
call dbms_stats.gather_table_stats('test', 'region', degree=>{cpu_total}, granularity=>'AUTO', method_opt=>'FOR ALL COLUMNS SIZE AUTO');
4 changes: 2 additions & 2 deletions plugins/tpch/4.0.0.0/run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@ def local_execute_command(command, env=None, timeout=None):
end_time = time.time()
cost = end_time - start_time
total_cost += cost
stdio.print('[%s]: end %s, cost %.1fs' % (time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(end_time)), path, cost))
stdio.print('[%s]: end %s, cost %.2fs' % (time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(end_time)), path, cost))
if not ret:
raise Exception(ret.stderr)
stdio.print('Total Cost: %.1fs' % total_cost)
stdio.print('Total Cost: %.2fs' % total_cost)
return plugin_context.return_true()
except KeyboardInterrupt:
stdio.stop_loading('fail')
Expand Down

0 comments on commit 9789592

Please sign in to comment.