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
7dc6eefb
Commit
7dc6eefb
authored
Apr 29, 2011
by
Igor Babaev
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
e89705ca
ad250abc
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 @
7dc6eefb
...
@@ -998,6 +998,13 @@ ID Name Country Population
...
@@ -998,6 +998,13 @@ ID Name Country Population
1898 Chengdu CHN 3361500
1898 Chengdu CHN 3361500
1900 Changchun CHN 2812000
1900 Changchun CHN 2812000
1910 Changsha CHN 1809800
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;
DROP DATABASE world;
use test;
use test;
CREATE TABLE t1 (
CREATE TABLE t1 (
...
...
mysql-test/r/index_intersect_innodb.result
View file @
7dc6eefb
...
@@ -999,6 +999,13 @@ ID Name Country Population
...
@@ -999,6 +999,13 @@ ID Name Country Population
1898 Chengdu CHN 3361500
1898 Chengdu CHN 3361500
1900 Changchun CHN 2812000
1900 Changchun CHN 2812000
1910 Changsha CHN 1809800
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;
DROP DATABASE world;
use test;
use test;
CREATE TABLE t1 (
CREATE TABLE t1 (
...
...
mysql-test/t/index_intersect.test
View file @
7dc6eefb
...
@@ -396,6 +396,17 @@ SELECT * FROM City
...
@@ -396,6 +396,17 @@ SELECT * FROM City
WHERE
Country
=
'CHN'
AND
Population
>
1500000
AND
Name
LIKE
'C%'
;
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
;
DROP
DATABASE
world
;
use
test
;
use
test
;
...
...
sql/opt_range.cc
View file @
7dc6eefb
...
@@ -3116,7 +3116,9 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
...
@@ -3116,7 +3116,9 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
best_read_time
)))
best_read_time
)))
{
{
best_trp
=
intersect_trp
;
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