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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
b890c05b
Commit
b890c05b
authored
Apr 26, 2005
by
sergefp@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge 5.0-build -> 5.0 : keep NDB_VERSION_BUILD=6
parents
a22ec942
a27e8303
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
sql/opt_range.cc
sql/opt_range.cc
+11
-6
No files found.
sql/opt_range.cc
View file @
b890c05b
...
...
@@ -2257,8 +2257,7 @@ inline double get_index_only_read_time(const PARAM* param, ha_rows records,
param
->
table
->
file
->
ref_length
)
+
1
);
read_time
=
((
double
)
(
records
+
keys_per_block
-
1
)
/
(
double
)
keys_per_block
);
/* Add 0.01 to avoid cost races between 'range' and 'index' */
return
read_time
+
0.01
;
return
read_time
;
}
...
...
@@ -3150,10 +3149,16 @@ static TRP_RANGE *get_key_scans_params(PARAM *param, SEL_TREE *tree,
(
param
->
table
->
file
->
index_flags
(
keynr
,
param
->
max_key_part
,
1
)
&
HA_KEYREAD_ONLY
)
&&
!
(
pk_is_clustered
&&
keynr
==
param
->
table
->
s
->
primary_key
))
/* We can resolve this by only reading through this key. */
{
/*
We can resolve this by only reading through this key.
0.01 is added to avoid races between range and 'index' scan.
*/
found_read_time
=
get_index_only_read_time
(
param
,
found_records
,
keynr
)
+
cpu_cost
;
cpu_cost
+
0.01
;
}
else
{
/*
cost(read_through_index) = cost(disk_io) + cost(row_in_range_checks)
The row_in_range check is in QUICK_RANGE_SELECT::cmp_next function.
...
...
@@ -3161,8 +3166,8 @@ static TRP_RANGE *get_key_scans_params(PARAM *param, SEL_TREE *tree,
found_read_time
=
param
->
table
->
file
->
read_time
(
keynr
,
param
->
range_count
,
found_records
)
+
cpu_cost
;
cpu_cost
+
0.01
;
}
DBUG_PRINT
(
"info"
,(
"key %s: found_read_time: %g (cur. read_time: %g)"
,
param
->
table
->
key_info
[
keynr
].
name
,
found_read_time
,
read_time
));
...
...
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