Fix issue: Fix bugs on the index advisor: repair log extraction function

This commit is contained in:
liuly
2021-08-03 11:45:29 +00:00
committed by Gitee
parent 30af811c4f
commit a73faa8504
3 changed files with 3 additions and 3 deletions

View File

@ -144,7 +144,7 @@ def record_sql(valid_files, args, output_obj):
file_path = os.path.join(args.l, file)
if os.path.isfile(file_path) and re.search(r'.log$', file):
start_position = 0
if ind == 0:
if ind == 0 and args.start_time:
start_position = get_start_position(args.start_time, file_path)
if start_position == -1:
continue

View File

@ -215,7 +215,7 @@ def display_recommend_result(workload, candidate_indexes, index_cost_total,
sql_detail['sqlTemplate'] = sql_template
sql_detail['sql'] = workload[pos].statement
sql_detail['sqlCount'] = sql_count
sql_detail['sqlCount'] = int(round(sql_count))
if category == 1:
sql_optimzed = (workload[pos].cost_list[0] -
workload[pos].cost_list[cost_list_pos]) / \

View File

@ -205,7 +205,7 @@ def display_recommend_result(workload, candidate_indexes, index_cost_total,
sql_detail['sqlTemplate'] = sql_template
sql_detail['sql'] = workload[pos].statement
sql_detail['sqlCount'] = sql_count
sql_detail['sqlCount'] = int(round(sql_count)
if category == 1:
sql_optimzed = (workload[pos].cost_list[0] -
workload[pos].cost_list[cost_list_pos]) / \