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
742b759d
Commit
742b759d
authored
May 29, 2004
by
sergefp@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Undo of range optimizer fix from previous changeset
* Fixed test results.
parent
dff98a8e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
13 deletions
+16
-13
mysql-test/r/index_merge_ror.result
mysql-test/r/index_merge_ror.result
+1
-0
mysql-test/r/rowid_order_bdb.result
mysql-test/r/rowid_order_bdb.result
+1
-1
mysql-test/r/rowid_order_innodb.result
mysql-test/r/rowid_order_innodb.result
+1
-1
sql/opt_range.cc
sql/opt_range.cc
+13
-11
No files found.
mysql-test/r/index_merge_ror.result
View file @
742b759d
...
@@ -193,3 +193,4 @@ insert into t2 values ('ab', 'ab', 'uh', 'oh');
...
@@ -193,3 +193,4 @@ insert into t2 values ('ab', 'ab', 'uh', 'oh');
explain select a from t2 where a='ab';
explain select a from t2 where a='ab';
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ref a a 6 const 1 Using where
1 SIMPLE t2 ref a a 6 const 1 Using where
drop table t2;
mysql-test/r/rowid_order_bdb.result
View file @
742b759d
...
@@ -14,7 +14,7 @@ insert into t1 values (-5, 1, 1),
...
@@ -14,7 +14,7 @@ insert into t1 values (-5, 1, 1),
(10, 1, 1);
(10, 1, 1);
explain select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
explain select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge key1,key2 key1,key2 5,5 NULL 5 Using where
1 SIMPLE t1 index_merge key1,key2 key1,key2 5,5 NULL 5 Using
sort_union(key1,key2); Using
where
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
pk1 key1 key2
pk1 key1 key2
-100 1 1
-100 1 1
...
...
mysql-test/r/rowid_order_innodb.result
View file @
742b759d
...
@@ -14,7 +14,7 @@ insert into t1 values (-5, 1, 1),
...
@@ -14,7 +14,7 @@ insert into t1 values (-5, 1, 1),
(10, 1, 1);
(10, 1, 1);
explain select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
explain select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge key1,key2 key1,key2 5,5 NULL 6 Using where
1 SIMPLE t1 index_merge key1,key2 key1,key2 5,5 NULL 6 Using
sort_union(key1,key2); Using
where
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
pk1 key1 key2
pk1 key1 key2
-100 1 1
-100 1 1
...
...
sql/opt_range.cc
View file @
742b759d
...
@@ -1610,17 +1610,6 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
...
@@ -1610,17 +1610,6 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
}
}
param
.
key_parts_end
=
key_parts
;
param
.
key_parts_end
=
key_parts
;
/* Calculate cost of full index read for the shortest covering index */
if
(
!
head
->
used_keys
.
is_clear_all
())
{
int
key_for_use
=
find_shortest_key
(
head
,
&
head
->
used_keys
);
double
key_read_time
=
get_index_only_read_time
(
&
param
,
records
,
key_for_use
);
DBUG_PRINT
(
"info"
,
(
"'all'+'using index' scan will be using key %d, "
"read time %g"
,
key_for_use
,
key_read_time
));
if
(
key_read_time
<
read_time
)
read_time
=
key_read_time
;
}
if
((
tree
=
get_mm_tree
(
&
param
,
cond
)))
if
((
tree
=
get_mm_tree
(
&
param
,
cond
)))
{
{
...
@@ -1683,6 +1672,19 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
...
@@ -1683,6 +1672,19 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
SEL_IMERGE
*
imerge
;
SEL_IMERGE
*
imerge
;
TABLE_READ_PLAN
*
best_conj_trp
=
NULL
,
*
new_conj_trp
;
TABLE_READ_PLAN
*
best_conj_trp
=
NULL
,
*
new_conj_trp
;
LINT_INIT
(
new_conj_trp
);
/* no empty index_merge lists possible */
LINT_INIT
(
new_conj_trp
);
/* no empty index_merge lists possible */
/* Calculate cost of full index read for the shortest covering index */
if
(
!
head
->
used_keys
.
is_clear_all
())
{
int
key_for_use
=
find_shortest_key
(
head
,
&
head
->
used_keys
);
double
key_read_time
=
get_index_only_read_time
(
&
param
,
records
,
key_for_use
);
DBUG_PRINT
(
"info"
,
(
"'all'+'using index' scan will be using key %d, "
"read time %g"
,
key_for_use
,
key_read_time
));
if
(
key_read_time
<
read_time
)
read_time
=
key_read_time
;
}
DBUG_PRINT
(
"info"
,(
"No range reads possible,"
DBUG_PRINT
(
"info"
,(
"No range reads possible,"
" trying to construct index_merge"
));
" trying to construct index_merge"
));
List_iterator_fast
<
SEL_IMERGE
>
it
(
tree
->
merges
);
List_iterator_fast
<
SEL_IMERGE
>
it
(
tree
->
merges
);
...
...
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