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
22311d27
Commit
22311d27
authored
Apr 26, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge 5.0-build -> 5.0 : keep NDB_VERSION_BUILD=6
parents
c6c0665a
09c3e18f
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 @
22311d27
...
...
@@ -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