未验证 提交 97895924 编写于 作者: R Rongfeng Fu 提交者: GitHub

tuning (#154)

上级 7a8232ed
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;
\ No newline at end of file
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');
\ No newline at end of file
......@@ -227,10 +227,10 @@ def run_test(plugin_context, db, cursor, *args, **kwargs):
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')
......
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;
\ No newline at end of file
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');
\ No newline at end of file
......@@ -243,10 +243,10 @@ def run_test(plugin_context, db, cursor, *args, **kwargs):
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')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册