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
82270288
Commit
82270288
authored
Nov 28, 2003
by
sergefp@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/psergey/mysql-5.0
parents
d8bf426b
ae159473
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
10 deletions
+22
-10
mysql-test/r/index_merge.result
mysql-test/r/index_merge.result
+5
-0
mysql-test/t/index_merge.test
mysql-test/t/index_merge.test
+4
-0
sql/opt_range.cc
sql/opt_range.cc
+13
-10
No files found.
mysql-test/r/index_merge.result
View file @
82270288
...
...
@@ -270,6 +270,11 @@ explain select * from t0,t1 where t0.key1 = 5 and
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ref i1 i1 4 const 1 Using where
1 SIMPLE t1 index_merge i1,i8 i1,i8 4,4 NULL 2 Using where
explain select * from t0,t1 where t0.key1 < 3 and
(t1.key1 = t0.key1 or t1.key8 = t0.key1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 range i1 i1 4 NULL 3 Using where
1 SIMPLE t1 ALL i1,i8 NULL NULL NULL 1024 Range checked for each record (index map: 0x81)
explain select * from t1 where key1=3 or key2=4
union select * from t1 where key1<4 or key3=5;
id select_type table type possible_keys key key_len ref rows Extra
...
...
mysql-test/t/index_merge.test
View file @
82270288
...
...
@@ -237,6 +237,10 @@ select * from t0,t1 where (t0.key1=t1.key1) and
explain
select
*
from
t0
,
t1
where
t0
.
key1
=
5
and
(
t1
.
key1
=
t0
.
key1
or
t1
.
key8
=
t0
.
key1
);
# Fix for bug#1974
explain
select
*
from
t0
,
t1
where
t0
.
key1
<
3
and
(
t1
.
key1
=
t0
.
key1
or
t1
.
key8
=
t0
.
key1
);
# index_merge inside union
explain
select
*
from
t1
where
key1
=
3
or
key2
=
4
union
select
*
from
t1
where
key1
<
4
or
key3
=
5
;
...
...
sql/opt_range.cc
View file @
82270288
...
...
@@ -1018,6 +1018,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
List_iterator_fast
<
SEL_IMERGE
>
it
(
tree
->
merges
);
while
((
imerge
=
it
++
))
{
bool
imerge_failed
=
false
;
double
imerge_cost
=
0
;
ha_rows
imerge_total_records
=
0
;
double
tree_read_time
;
...
...
@@ -1036,21 +1037,23 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
&
tree_read_time
,
&
tree_records
,
&
(
imerge
->
best_keys
[
ptree
-
imerge
->
trees
])))
goto
imerge_fail
;
imerge_failed
=
true
;
imerge_cost
+=
tree_read_time
;
imerge_total_records
+=
tree_records
;
}
imerge_total_records
=
min
(
imerge_total_records
,
head
->
file
->
records
);
imerge_cost
+=
imerge_total_records
/
TIME_FOR_COMPARE
;
if
(
imerge_cost
<
min_imerge_cost
)
if
(
!
imerge_failed
)
{
min_imerge
=
imerge
;
min_imerge_cost
=
imerge_cost
;
min_imerge_records
=
imerge_total_records
;
imerge_total_records
=
min
(
imerge_total_records
,
head
->
file
->
records
);
imerge_cost
+=
imerge_total_records
/
TIME_FOR_COMPARE
;
if
(
imerge_cost
<
min_imerge_cost
)
{
min_imerge
=
imerge
;
min_imerge_cost
=
imerge_cost
;
min_imerge_records
=
imerge_total_records
;
}
}
imerge_fail:
;
}
if
(
!
min_imerge
)
...
...
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