mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Post-second-review fixes for the patch that added the code allowing to use
hash join over equi-join conditions without supporting indexes.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -46,14 +46,16 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
|
|||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
SELECT City.Name, Country.Name, CountryLanguage.Language
|
SELECT City.Name, Country.Name, CountryLanguage.Language
|
||||||
FROM City,Country,CountryLanguage
|
FROM City,Country,CountryLanguage
|
||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
set join_cache_level=2;
|
set join_cache_level=2;
|
||||||
show variables like 'join_cache_level';
|
show variables like 'join_cache_level';
|
||||||
@@ -73,14 +75,16 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
|
|||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
SELECT City.Name, Country.Name, CountryLanguage.Language
|
SELECT City.Name, Country.Name, CountryLanguage.Language
|
||||||
FROM City,Country,CountryLanguage
|
FROM City,Country,CountryLanguage
|
||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
set join_cache_level=3;
|
set join_cache_level=3;
|
||||||
show variables like 'join_cache_level';
|
show variables like 'join_cache_level';
|
||||||
@@ -100,14 +104,18 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
|
|||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
|
|
||||||
SELECT City.Name, Country.Name, CountryLanguage.Language
|
SELECT City.Name, Country.Name, CountryLanguage.Language
|
||||||
FROM City,Country,CountryLanguage
|
FROM City,Country,CountryLanguage
|
||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
|
|
||||||
set join_cache_level=4;
|
set join_cache_level=4;
|
||||||
show variables like 'join_cache_level';
|
show variables like 'join_cache_level';
|
||||||
@@ -127,14 +135,16 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
|
|||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
SELECT City.Name, Country.Name, CountryLanguage.Language
|
SELECT City.Name, Country.Name, CountryLanguage.Language
|
||||||
FROM City,Country,CountryLanguage
|
FROM City,Country,CountryLanguage
|
||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
set join_cache_level=default;
|
set join_cache_level=default;
|
||||||
|
|
||||||
@@ -158,14 +168,16 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
|
|||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
SELECT City.Name, Country.Name, CountryLanguage.Language
|
SELECT City.Name, Country.Name, CountryLanguage.Language
|
||||||
FROM City,Country,CountryLanguage
|
FROM City,Country,CountryLanguage
|
||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
set join_cache_level=2;
|
set join_cache_level=2;
|
||||||
show variables like 'join_cache_level';
|
show variables like 'join_cache_level';
|
||||||
@@ -185,14 +197,16 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
|
|||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
SELECT City.Name, Country.Name, CountryLanguage.Language
|
SELECT City.Name, Country.Name, CountryLanguage.Language
|
||||||
FROM City,Country,CountryLanguage
|
FROM City,Country,CountryLanguage
|
||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
set join_cache_level=3;
|
set join_cache_level=3;
|
||||||
show variables like 'join_cache_level';
|
show variables like 'join_cache_level';
|
||||||
@@ -212,14 +226,16 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
|
|||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
SELECT City.Name, Country.Name, CountryLanguage.Language
|
SELECT City.Name, Country.Name, CountryLanguage.Language
|
||||||
FROM City,Country,CountryLanguage
|
FROM City,Country,CountryLanguage
|
||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
set join_cache_level=4;
|
set join_cache_level=4;
|
||||||
show variables like 'join_cache_level';
|
show variables like 'join_cache_level';
|
||||||
@@ -239,14 +255,16 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
|
|||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
SELECT City.Name, Country.Name, CountryLanguage.Language
|
SELECT City.Name, Country.Name, CountryLanguage.Language
|
||||||
FROM City,Country,CountryLanguage
|
FROM City,Country,CountryLanguage
|
||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
set join_cache_level=default;
|
set join_cache_level=default;
|
||||||
set join_buffer_size=default;
|
set join_buffer_size=default;
|
||||||
@@ -290,14 +308,16 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
|
|||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
SELECT City.Name, Country.Name, CountryLanguage.Language
|
SELECT City.Name, Country.Name, CountryLanguage.Language
|
||||||
FROM City,Country,CountryLanguage
|
FROM City,Country,CountryLanguage
|
||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
EXPLAIN
|
EXPLAIN
|
||||||
SELECT Name FROM City
|
SELECT Name FROM City
|
||||||
@@ -340,14 +360,16 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
|
|||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
SELECT City.Name, Country.Name, CountryLanguage.Language
|
SELECT City.Name, Country.Name, CountryLanguage.Language
|
||||||
FROM City,Country,CountryLanguage
|
FROM City,Country,CountryLanguage
|
||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
EXPLAIN
|
EXPLAIN
|
||||||
SELECT Name FROM City
|
SELECT Name FROM City
|
||||||
@@ -391,14 +413,16 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
|
|||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
SELECT City.Name, Country.Name, CountryLanguage.Language
|
SELECT City.Name, Country.Name, CountryLanguage.Language
|
||||||
FROM City,Country,CountryLanguage
|
FROM City,Country,CountryLanguage
|
||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
EXPLAIN
|
EXPLAIN
|
||||||
SELECT Name FROM City
|
SELECT Name FROM City
|
||||||
@@ -440,14 +464,16 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
|
|||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
SELECT City.Name, Country.Name, CountryLanguage.Language
|
SELECT City.Name, Country.Name, CountryLanguage.Language
|
||||||
FROM City,Country,CountryLanguage
|
FROM City,Country,CountryLanguage
|
||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
EXPLAIN
|
EXPLAIN
|
||||||
SELECT Name FROM City
|
SELECT Name FROM City
|
||||||
@@ -489,14 +515,16 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
|
|||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
SELECT City.Name, Country.Name, CountryLanguage.Language
|
SELECT City.Name, Country.Name, CountryLanguage.Language
|
||||||
FROM City,Country,CountryLanguage
|
FROM City,Country,CountryLanguage
|
||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
EXPLAIN
|
EXPLAIN
|
||||||
SELECT Name FROM City
|
SELECT Name FROM City
|
||||||
@@ -538,14 +566,16 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
|
|||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
SELECT City.Name, Country.Name, CountryLanguage.Language
|
SELECT City.Name, Country.Name, CountryLanguage.Language
|
||||||
FROM City,Country,CountryLanguage
|
FROM City,Country,CountryLanguage
|
||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
EXPLAIN
|
EXPLAIN
|
||||||
SELECT Name FROM City
|
SELECT Name FROM City
|
||||||
@@ -590,14 +620,16 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
|
|||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
SELECT City.Name, Country.Name, CountryLanguage.Language
|
SELECT City.Name, Country.Name, CountryLanguage.Language
|
||||||
FROM City,Country,CountryLanguage
|
FROM City,Country,CountryLanguage
|
||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
EXPLAIN
|
EXPLAIN
|
||||||
SELECT Name FROM City
|
SELECT Name FROM City
|
||||||
@@ -626,14 +658,16 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
|
|||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
SELECT City.Name, Country.Name, CountryLanguage.Language
|
SELECT City.Name, Country.Name, CountryLanguage.Language
|
||||||
FROM City,Country,CountryLanguage
|
FROM City,Country,CountryLanguage
|
||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
EXPLAIN
|
EXPLAIN
|
||||||
SELECT Name FROM City
|
SELECT Name FROM City
|
||||||
@@ -662,14 +696,16 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
|
|||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
SELECT City.Name, Country.Name, CountryLanguage.Language
|
SELECT City.Name, Country.Name, CountryLanguage.Language
|
||||||
FROM City,Country,CountryLanguage
|
FROM City,Country,CountryLanguage
|
||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
EXPLAIN
|
EXPLAIN
|
||||||
SELECT Name FROM City
|
SELECT Name FROM City
|
||||||
@@ -698,14 +734,16 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
|
|||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
SELECT City.Name, Country.Name, CountryLanguage.Language
|
SELECT City.Name, Country.Name, CountryLanguage.Language
|
||||||
FROM City,Country,CountryLanguage
|
FROM City,Country,CountryLanguage
|
||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
EXPLAIN
|
EXPLAIN
|
||||||
SELECT Name FROM City
|
SELECT Name FROM City
|
||||||
@@ -734,14 +772,16 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
|
|||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
SELECT City.Name, Country.Name, CountryLanguage.Language
|
SELECT City.Name, Country.Name, CountryLanguage.Language
|
||||||
FROM City,Country,CountryLanguage
|
FROM City,Country,CountryLanguage
|
||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
EXPLAIN
|
EXPLAIN
|
||||||
SELECT Name FROM City
|
SELECT Name FROM City
|
||||||
@@ -770,14 +810,16 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
|
|||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
SELECT City.Name, Country.Name, CountryLanguage.Language
|
SELECT City.Name, Country.Name, CountryLanguage.Language
|
||||||
FROM City,Country,CountryLanguage
|
FROM City,Country,CountryLanguage
|
||||||
WHERE City.Country=Country.Code AND
|
WHERE City.Country=Country.Code AND
|
||||||
CountryLanguage.Country=Country.Code AND
|
CountryLanguage.Country=Country.Code AND
|
||||||
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
City.Name LIKE 'L%' AND Country.Population > 3000000 AND
|
||||||
CountryLanguage.Percentage > 50;
|
CountryLanguage.Percentage > 50 AND
|
||||||
|
LENGTH(Language) < LENGTH(City.Name) - 2;
|
||||||
|
|
||||||
EXPLAIN
|
EXPLAIN
|
||||||
SELECT Name FROM City
|
SELECT Name FROM City
|
||||||
|
@@ -6445,6 +6445,7 @@ static bool create_hj_key_for_table(JOIN *join, JOIN_TAB *join_tab,
|
|||||||
} while (keyuse->table == table && keyuse->is_for_hash_join());
|
} while (keyuse->table == table && keyuse->is_for_hash_join());
|
||||||
if (!key_parts)
|
if (!key_parts)
|
||||||
DBUG_RETURN(TRUE);
|
DBUG_RETURN(TRUE);
|
||||||
|
/* This memory is allocated only once for the joined table join_tab */
|
||||||
if (!(keyinfo= (KEY *) thd->alloc(sizeof(KEY))) ||
|
if (!(keyinfo= (KEY *) thd->alloc(sizeof(KEY))) ||
|
||||||
!(key_part_info = (KEY_PART_INFO *) thd->alloc(sizeof(KEY_PART_INFO)*
|
!(key_part_info = (KEY_PART_INFO *) thd->alloc(sizeof(KEY_PART_INFO)*
|
||||||
key_parts)))
|
key_parts)))
|
||||||
@@ -6525,18 +6526,14 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j,
|
|||||||
{
|
{
|
||||||
if (!(~used_tables & keyuse->used_tables))
|
if (!(~used_tables & keyuse->used_tables))
|
||||||
{
|
{
|
||||||
if (is_hash_join_key_no(key) &&
|
if ((is_hash_join_key_no(key) &&
|
||||||
(keyparts == 0 || keyuse->keypart != (keyuse-1)->keypart))
|
(keyparts == 0 || keyuse->keypart != (keyuse-1)->keypart)) ||
|
||||||
|
(!is_hash_join_key_no(key) && keyparts == keyuse->keypart &&
|
||||||
|
!(found_part_ref_or_null & keyuse->optimize)))
|
||||||
{
|
{
|
||||||
length+= keyinfo->key_part[keyparts].store_length;
|
length+= keyinfo->key_part[keyparts].store_length;
|
||||||
keyparts++;
|
keyparts++;
|
||||||
}
|
found_part_ref_or_null|= keyuse->optimize & ~KEY_OPTIMIZE_EQ;
|
||||||
else if (!is_hash_join_key_no(key) && keyparts == keyuse->keypart &&
|
|
||||||
!(found_part_ref_or_null & keyuse->optimize))
|
|
||||||
{
|
|
||||||
length+= keyinfo->key_part[keyuse->keypart].store_length;
|
|
||||||
found_part_ref_or_null|= keyuse->optimize;
|
|
||||||
keyparts++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
keyuse++;
|
keyuse++;
|
||||||
|
Reference in New Issue
Block a user