mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Fix number of rows passing in case of EQ_REF
This commit is contained in:
@@ -7557,6 +7557,7 @@ best_access_path(JOIN *join,
|
|||||||
rec= MATCHING_ROWS_IN_OTHER_TABLE; // Fix for small tables
|
rec= MATCHING_ROWS_IN_OTHER_TABLE; // Fix for small tables
|
||||||
|
|
||||||
Json_writer_object trace_access_idx(thd);
|
Json_writer_object trace_access_idx(thd);
|
||||||
|
double eq_ref_rows= 0;
|
||||||
/*
|
/*
|
||||||
full text keys require special treatment
|
full text keys require special treatment
|
||||||
*/
|
*/
|
||||||
@@ -7595,7 +7596,8 @@ best_access_path(JOIN *join,
|
|||||||
type= JT_EQ_REF;
|
type= JT_EQ_REF;
|
||||||
trace_access_idx.add("access_type", join_type_str[type])
|
trace_access_idx.add("access_type", join_type_str[type])
|
||||||
.add("index", keyinfo->name);
|
.add("index", keyinfo->name);
|
||||||
tmp = prev_record_reads(join_positions, idx, found_ref);
|
eq_ref_rows= tmp = prev_record_reads(join_positions, idx,
|
||||||
|
found_ref);
|
||||||
records=1.0;
|
records=1.0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -7918,8 +7920,8 @@ best_access_path(JOIN *join,
|
|||||||
|
|
||||||
Set the effective number of rows from "tmp" here.
|
Set the effective number of rows from "tmp" here.
|
||||||
*/
|
*/
|
||||||
keyread_tmp= tmp/ 2;
|
keyread_tmp= COST_ADD(eq_ref_rows / 2, s->startup_cost);
|
||||||
rows= tmp;
|
rows= eq_ref_rows;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
rows= record_count * records;
|
rows= record_count * records;
|
||||||
|
Reference in New Issue
Block a user