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
29eec6c7
Commit
29eec6c7
authored
Sep 16, 2003
by
kostja@oak.local
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
join buffer cache usage/not usage is taken
into account to increase the cost of FULL SCAN
parent
2931565e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
sql/sql_select.cc
sql/sql_select.cc
+14
-4
No files found.
sql/sql_select.cc
View file @
29eec6c7
...
@@ -2133,11 +2133,21 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
...
@@ -2133,11 +2133,21 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
s
->
table
->
used_keys
&&
best_key
)
&&
s
->
table
->
used_keys
&&
best_key
)
&&
!
(
s
->
table
->
force_index
&&
best_key
))
!
(
s
->
table
->
force_index
&&
best_key
))
{
// Check full join
{
// Check full join
/*
/* Estimate cost of reading table. */
Estimate cost of reading table. Note, that we don't read a table
on each iteration as in most cases join buffer is in use.
*/
tmp
=
(
double
)
s
->
read_time
;
tmp
=
(
double
)
s
->
read_time
;
if
(
s
->
on_expr
)
// Can't use join cache
{
/* We have to read the whole table for each record */
tmp
*=
record_count
;
}
else
{
/* We read the table as many times as join buffer becomes full. */
tmp
*=
(
1.0
+
floor
((
double
)
cache_record_length
(
join
,
idx
)
*
record_count
/
(
double
)
thd
->
variables
.
join_buff_size
));
}
/*
/*
In case of full scan we check every row in the table:
In case of full scan we check every row in the table:
here we take into account rows read and skipped, as well as rows
here we take into account rows read and skipped, as well as rows
...
...
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