Fix issue: Fix bugs on the index advisor: repair log extraction function
This commit is contained in:
@ -144,7 +144,7 @@ def record_sql(valid_files, args, output_obj):
|
|||||||
file_path = os.path.join(args.l, file)
|
file_path = os.path.join(args.l, file)
|
||||||
if os.path.isfile(file_path) and re.search(r'.log$', file):
|
if os.path.isfile(file_path) and re.search(r'.log$', file):
|
||||||
start_position = 0
|
start_position = 0
|
||||||
if ind == 0:
|
if ind == 0 and args.start_time:
|
||||||
start_position = get_start_position(args.start_time, file_path)
|
start_position = get_start_position(args.start_time, file_path)
|
||||||
if start_position == -1:
|
if start_position == -1:
|
||||||
continue
|
continue
|
||||||
|
@ -215,7 +215,7 @@ def display_recommend_result(workload, candidate_indexes, index_cost_total,
|
|||||||
|
|
||||||
sql_detail['sqlTemplate'] = sql_template
|
sql_detail['sqlTemplate'] = sql_template
|
||||||
sql_detail['sql'] = workload[pos].statement
|
sql_detail['sql'] = workload[pos].statement
|
||||||
sql_detail['sqlCount'] = sql_count
|
sql_detail['sqlCount'] = int(round(sql_count))
|
||||||
if category == 1:
|
if category == 1:
|
||||||
sql_optimzed = (workload[pos].cost_list[0] -
|
sql_optimzed = (workload[pos].cost_list[0] -
|
||||||
workload[pos].cost_list[cost_list_pos]) / \
|
workload[pos].cost_list[cost_list_pos]) / \
|
||||||
|
@ -205,7 +205,7 @@ def display_recommend_result(workload, candidate_indexes, index_cost_total,
|
|||||||
|
|
||||||
sql_detail['sqlTemplate'] = sql_template
|
sql_detail['sqlTemplate'] = sql_template
|
||||||
sql_detail['sql'] = workload[pos].statement
|
sql_detail['sql'] = workload[pos].statement
|
||||||
sql_detail['sqlCount'] = sql_count
|
sql_detail['sqlCount'] = int(round(sql_count)
|
||||||
if category == 1:
|
if category == 1:
|
||||||
sql_optimzed = (workload[pos].cost_list[0] -
|
sql_optimzed = (workload[pos].cost_list[0] -
|
||||||
workload[pos].cost_list[cost_list_pos]) / \
|
workload[pos].cost_list[cost_list_pos]) / \
|
||||||
|
Reference in New Issue
Block a user