Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
373f7ea7
Commit
373f7ea7
authored
Sep 28, 2022
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compile on Windows: use explicit casts between double and ha_rows.
parent
5e651c9a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
sql/opt_range.cc
sql/opt_range.cc
+3
-3
sql/sql_select.cc
sql/sql_select.cc
+10
-10
No files found.
sql/opt_range.cc
View file @
373f7ea7
...
...
@@ -7374,7 +7374,7 @@ TRP_ROR_INTERSECT *get_best_ror_intersect(const PARAM *param, SEL_TREE *tree,
TRP_ROR_INTERSECT
*
trp
=
NULL
;
if
(
min_cost
+
cmp_cost
<
read_time
&&
(
cpk_scan
||
best_num
>
1
))
{
double
best_rows
=
double2rows
(
intersect_best
->
out_rows
)
;
double
best_rows
=
intersect_best
->
out_rows
;
set_if_bigger
(
best_rows
,
1
);
if
(
!
(
trp
=
new
(
param
->
mem_root
)
TRP_ROR_INTERSECT
))
DBUG_RETURN
(
NULL
);
...
...
@@ -7386,8 +7386,8 @@ TRP_ROR_INTERSECT *get_best_ror_intersect(const PARAM *param, SEL_TREE *tree,
trp
->
last_scan
=
trp
->
first_scan
+
best_num
;
trp
->
is_covering
=
intersect_best
->
is_covering
;
trp
->
read_cost
=
min_cost
+
cmp_cost
;
param
->
table
->
set_opt_range_condition_rows
(
best_rows
);
trp
->
records
=
best_rows
;
param
->
table
->
set_opt_range_condition_rows
(
(
ha_rows
)
best_rows
);
trp
->
records
=
(
ha_rows
)
best_rows
;
trp
->
index_scan_costs
=
intersect_best
->
index_scan_costs
;
trp
->
cpk_scan
=
cpk_scan
;
DBUG_PRINT
(
"info"
,
(
"Returning non-covering ROR-intersect plan:"
...
...
sql/sql_select.cc
View file @
373f7ea7
...
...
@@ -7837,13 +7837,13 @@ INDEX_READ_COST cost_for_index_read(const THD *thd, const TABLE *table,
double rows_adjusted;
DBUG_ENTER("cost_for_index_read");
rows_adjusted= MY_MIN(r
ecords, (ha_rows
) thd->variables.max_seeks_for_key);
rows_adjusted= MY_MIN(r
ows2double(records), (double
) thd->variables.max_seeks_for_key);
#ifdef OLD_CODE_LIMITED_SEEKS
set_if_smaller(rows_adjusted, worst_seeks);
#endif
if (file->is_clustering_key(key))
{
cost.index_only_cost= file->ha_read_time(key, 1, rows_adjusted);
cost.index_only_cost= file->ha_read_time(key, 1,
(ha_rows)
rows_adjusted);
/*
Same computation as in ha_read_and_copy_time()
We do it explicitely here as we want to use the original value of
...
...
@@ -7854,20 +7854,20 @@ INDEX_READ_COST cost_for_index_read(const THD *thd, const TABLE *table,
}
else if (table->covering_keys.is_set(key) && !table->no_keyread)
{
cost.index_only_cost= file->ha_keyread_time(key, 1, rows_adjusted);
cost.index_only_cost= file->ha_keyread_time(key, 1,
(ha_rows)
rows_adjusted);
/* Same computation as in ha_keyread_and_copy_time() */
cost.read_cost= (cost.index_only_cost +
rows2double(records) * KEY_COPY_COST_THD(thd));
}
else
{
cost.index_only_cost= file->ha_keyread_time(key, 1, rows_adjusted);
cost.index_only_cost= file->ha_keyread_time(key, 1,
(ha_rows)
rows_adjusted);
/*
Note that ha_read_time() + ..ROW_COPY_COST should be same
as ha_rnd_pos_time().
*/
cost.read_cost= (cost.index_only_cost +
file->ha_read_time(key, 0, rows_adjusted) +
file->ha_read_time(key, 0,
(ha_rows)
rows_adjusted) +
rows2double(records) * ROW_COPY_COST_THD(thd));
}
DBUG_PRINT("statistics", ("index_cost: %.3f full_cost: %.3f",
...
...
@@ -8855,7 +8855,7 @@ best_access_path(JOIN *join,
This is done to make records found comparable to what we get with
'ref' access.
*/
org_records= records_after_filter= rnd_records=
s->found_records
;
org_records= records_after_filter= rnd_records=
rows2double(s->found_records)
;
if (s->quick->get_type() == QUICK_SELECT_I::QS_TYPE_RANGE)
{
...
...
@@ -8873,7 +8873,7 @@ best_access_path(JOIN *join,
range->cost / s->quick->read_time >= 0.9999999));
filter=
table->best_range_rowid_filter_for_partial_join(key_no, r
ange->rows
,
table->best_range_rowid_filter_for_partial_join(key_no, r
ows2double(range->rows)
,
range->find_cost,
range->index_only_cost,
record_count);
...
...
@@ -8913,7 +8913,7 @@ best_access_path(JOIN *join,
rnd_records= matching_candidates_in_table(s, found_constraint,
use_cond_selectivity);
records_after_filter= rnd_records;
org_records=
s->records
;
org_records=
rows2double(s->records)
;
DBUG_ASSERT(rnd_records <= s->records);
/* Estimate cost of reading table. */
...
...
@@ -8921,7 +8921,7 @@ best_access_path(JOIN *join,
{
INDEX_READ_COST cost= cost_for_index_read(thd, table, s->ref.key,
s->records,
s->worst_seeks);
(ha_rows)
s->worst_seeks);
/*
The query is using 'force_index' and we did not find a usable key.
Caclulcate cost of a table scan with the forced index.
...
...
@@ -29923,7 +29923,7 @@ static bool get_range_limit_read_cost(const JOIN_TAB *tab,
{
INDEX_READ_COST cost= cost_for_index_read(tab->join->thd, table,
keynr,
ref_rows,
(ha_rows)
ref_rows,
(ha_rows) tab->worst_seeks);
if (cost.read_cost < best_cost)
{
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment