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
80b0b300
Commit
80b0b300
authored
Apr 29, 2011
by
Igor Babaev
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
2721e912
1556a136
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
1 deletion
+28
-1
mysql-test/r/index_intersect.result
mysql-test/r/index_intersect.result
+7
-0
mysql-test/r/index_intersect_innodb.result
mysql-test/r/index_intersect_innodb.result
+7
-0
mysql-test/t/index_intersect.test
mysql-test/t/index_intersect.test
+11
-0
sql/opt_range.cc
sql/opt_range.cc
+3
-1
No files found.
mysql-test/r/index_intersect.result
View file @
80b0b300
...
...
@@ -998,6 +998,13 @@ ID Name Country Population
1898 Chengdu CHN 3361500
1900 Changchun CHN 2812000
1910 Changsha CHN 1809800
EXPLAIN
SELECT * FROM City, Country
WHERE City.Name LIKE 'C%' AND City.Population > 1000000 AND
Country.Code=City.Country;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE City index_merge Population,Name,CountryID,CountryName Name,Population 35,4 NULL # Using sort_intersect(Name,Population); Using where
1 SIMPLE Country eq_ref PRIMARY PRIMARY 3 world.City.Country #
DROP DATABASE world;
use test;
CREATE TABLE t1 (
...
...
mysql-test/r/index_intersect_innodb.result
View file @
80b0b300
...
...
@@ -999,6 +999,13 @@ ID Name Country Population
1898 Chengdu CHN 3361500
1900 Changchun CHN 2812000
1910 Changsha CHN 1809800
EXPLAIN
SELECT * FROM City, Country
WHERE City.Name LIKE 'C%' AND City.Population > 1000000 AND
Country.Code=City.Country;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE City index_merge Population,Name,CountryID,CountryName Population,Name 4,35 NULL # Using sort_intersect(Population,Name); Using where
1 SIMPLE Country eq_ref PRIMARY PRIMARY 3 world.City.Country #
DROP DATABASE world;
use test;
CREATE TABLE t1 (
...
...
mysql-test/t/index_intersect.test
View file @
80b0b300
...
...
@@ -396,6 +396,17 @@ SELECT * FROM City
WHERE
Country
=
'CHN'
AND
Population
>
1500000
AND
Name
LIKE
'C%'
;
#
# Bug #754521: wrong cost of index intersection leading
# to the choice of a suboptimal execution plan
#
--
replace_column
9
#
EXPLAIN
SELECT
*
FROM
City
,
Country
WHERE
City
.
Name
LIKE
'C%'
AND
City
.
Population
>
1000000
AND
Country
.
Code
=
City
.
Country
;
DROP
DATABASE
world
;
use
test
;
...
...
sql/opt_range.cc
View file @
80b0b300
...
...
@@ -3116,7 +3116,9 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
best_read_time
)))
{
best_trp
=
intersect_trp
;
best_read_time
=
best_trp
->
read_cost
;
best_read_time
=
best_trp
->
read_cost
;
set_if_smaller
(
param
.
table
->
quick_condition_rows
,
intersect_trp
->
records
);
}
}
...
...
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