[Commits] Rev 2895: Post-second-review fixes for the patch that added the code allowing to use in file:///home/igor/maria/maria-5.3-mwl128-review/

Igor Babaev igor at askmonty.org
Tue Jan 25 00:54:51 EET 2011


At file:///home/igor/maria/maria-5.3-mwl128-review/

------------------------------------------------------------
revno: 2895
revision-id: igor at askmonty.org-20110124225450-6rq15gqjcnon3cwr
parent: igor at askmonty.org-20110123183953-cwuzs1rvfum6235p
committer: Igor Babaev <igor at askmonty.org>
branch nick: maria-5.3-mwl128-review
timestamp: Mon 2011-01-24 14:54:50 -0800
message:
  Post-second-review fixes for the patch that added the code allowing to use
  hash join over equi-join conditions without supporting indexes.
-------------- next part --------------
=== modified file 'mysql-test/r/join_cache.result'
--- a/mysql-test/r/join_cache.result	2011-01-22 06:48:28 +0000
+++ b/mysql-test/r/join_cache.result	2011-01-24 22:54:50 +0000
@@ -71,7 +71,8 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	Country	ALL	NULL	NULL	NULL	NULL	239	Using where
 1	SIMPLE	CountryLanguage	ALL	NULL	NULL	NULL	NULL	984	Using where; Using join buffer (flat, BNL join)
@@ -81,148 +82,37 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 Name	Name	Language
-Leiden	Netherlands	Dutch
 La Matanza	Argentina	Spanish
 Lomas de Zamora	Argentina	Spanish
-La Plata	Argentina	Spanish
-Lan??s	Argentina	Spanish
-Las Heras	Argentina	Spanish
-La Rioja	Argentina	Spanish
-Li??ge	Belgium	Dutch
-La Paz	Bolivia	Spanish
-Londrina	Brazil	Portuguese
-Limeira	Brazil	Portuguese
-Lages	Brazil	Portuguese
-Luzi??nia	Brazil	Portuguese
 Lauro de Freitas	Brazil	Portuguese
-Linhares	Brazil	Portuguese
-London	United Kingdom	English
-Liverpool	United Kingdom	English
-Leeds	United Kingdom	English
-Leicester	United Kingdom	English
-Luton	United Kingdom	English
 Los Angeles	Chile	Spanish
-La Serena	Chile	Spanish
-La Romana	Dominican Republic	Spanish
-Loja	Ecuador	Spanish
-Luxor	Egypt	Arabic
 Las Palmas de Gran Canaria	Spain	Spanish
 L??Hospitalet de Llobregat	Spain	Spanish
-Legan??s	Spain	Spanish
-Le??n	Spain	Spanish
-Logro??o	Spain	Spanish
 Lleida (L??rida)	Spain	Spanish
-Le-Cap-Ha??tien	Haiti	Haiti Creole
-La Ceiba	Honduras	Spanish
-Livorno	Italy	Italian
-Latina	Italy	Italian
-Lecce	Italy	Italian
-La Spezia	Italy	Italian
-Linz	Austria	German
-London	Canada	English
-Laval	Canada	English
-Longueuil	Canada	English
-Lanzhou	China	Chinese
-Luoyang	China	Chinese
-Liuzhou	China	Chinese
-Liaoyang	China	Chinese
 Liupanshui	China	Chinese
-Liaoyuan	China	Chinese
 Lianyungang	China	Chinese
-Leshan	China	Chinese
-Linyi	China	Chinese
-Luzhou	China	Chinese
-Laiwu	China	Chinese
-Liaocheng	China	Chinese
-Laizhou	China	Chinese
-Linfen	China	Chinese
 Liangcheng	China	Chinese
-Longkou	China	Chinese
-Langfang	China	Chinese
-Liu??an	China	Chinese
-Longjing	China	Chinese
 Lengshuijiang	China	Chinese
-Laiyang	China	Chinese
-Longyan	China	Chinese
-Linhe	China	Chinese
-Leiyang	China	Chinese
-Loudi	China	Chinese
-Luohe	China	Chinese
-Linqing	China	Chinese
-Laohekou	China	Chinese
-Linchuan	China	Chinese
-Lhasa	China	Chinese
-Lianyuan	China	Chinese
-Liyang	China	Chinese
-Liling	China	Chinese
-Linhai	China	Chinese
-Larisa	Greece	Greek
-La Habana	Cuba	Spanish
-Lilongwe	Malawi	Chichewa
-Le??n	Mexico	Spanish
-La Paz	Mexico	Spanish
-La Paz	Mexico	Spanish
 L??zaro C??rdenas	Mexico	Spanish
 Lagos de Moreno	Mexico	Spanish
-Lerdo	Mexico	Spanish
-Los Cabos	Mexico	Spanish
-Lerma	Mexico	Spanish
 Las Margaritas	Mexico	Spanish
 Lashio (Lasho)	Myanmar	Burmese
 Lalitapur	Nepal	Nepali
-Le??n	Nicaragua	Spanish
-Lambar??	Paraguay	Spanish
-Lima	Peru	Spanish
-Lisboa	Portugal	Portuguese
-L??dz	Poland	Polish
-Lublin	Poland	Polish
-Legnica	Poland	Polish
-Lyon	France	French
-Le Havre	France	French
-Lille	France	French
-Le Mans	France	French
-Limoges	France	French
-Link??ping	Sweden	Swedish
-Lund	Sweden	Swedish
-Leipzig	Germany	German
-L??beck	Germany	German
 Ludwigshafen am Rhein	Germany	German
 Leverkusen	Germany	German
-L??nen	Germany	German
-Lahti	Finland	Finnish
-Lausanne	Switzerland	German
-Latakia	Syria	Arabic
 Luchou	Taiwan	Min
 Lungtan	Taiwan	Min
-Liberec	Czech Republic	Czech
-Lviv	Ukraine	Ukrainian
-Lugansk	Ukraine	Ukrainian
-Lutsk	Ukraine	Ukrainian
-Lysyt?ansk	Ukraine	Ukrainian
 Lower Hutt	New Zealand	English
-Lida	Belarus	Belorussian
 Los Teques	Venezuela	Spanish
-Lipetsk	Russian Federation	Russian
-Ljubertsy	Russian Federation	Russian
 Leninsk-Kuznetski	Russian Federation	Russian
-Long Xuyen	Vietnam	Vietnamese
 Los Angeles	United States	English
-Las Vegas	United States	English
 Long Beach	United States	English
 Lexington-Fayette	United States	English
 Louisville	United States	English
-Lincoln	United States	English
-Lubbock	United States	English
 Little Rock	United States	English
-Laredo	United States	English
-Lakewood	United States	English
-Lansing	United States	English
-Lancaster	United States	English
-Lafayette	United States	English
-Lowell	United States	English
-Livonia	United States	English
 set join_cache_level=2;
 show variables like 'join_cache_level';
 Variable_name	Value
@@ -259,7 +149,8 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	Country	ALL	NULL	NULL	NULL	NULL	239	Using where
 1	SIMPLE	CountryLanguage	ALL	NULL	NULL	NULL	NULL	984	Using where; Using join buffer (flat, BNL join)
@@ -269,148 +160,37 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 Name	Name	Language
-Leiden	Netherlands	Dutch
 La Matanza	Argentina	Spanish
 Lomas de Zamora	Argentina	Spanish
-La Plata	Argentina	Spanish
-Lan??s	Argentina	Spanish
-Las Heras	Argentina	Spanish
-La Rioja	Argentina	Spanish
-Li??ge	Belgium	Dutch
-La Paz	Bolivia	Spanish
-Londrina	Brazil	Portuguese
-Limeira	Brazil	Portuguese
-Lages	Brazil	Portuguese
-Luzi??nia	Brazil	Portuguese
 Lauro de Freitas	Brazil	Portuguese
-Linhares	Brazil	Portuguese
-London	United Kingdom	English
-Liverpool	United Kingdom	English
-Leeds	United Kingdom	English
-Leicester	United Kingdom	English
-Luton	United Kingdom	English
 Los Angeles	Chile	Spanish
-La Serena	Chile	Spanish
-La Romana	Dominican Republic	Spanish
-Loja	Ecuador	Spanish
-Luxor	Egypt	Arabic
 Las Palmas de Gran Canaria	Spain	Spanish
 L??Hospitalet de Llobregat	Spain	Spanish
-Legan??s	Spain	Spanish
-Le??n	Spain	Spanish
-Logro??o	Spain	Spanish
 Lleida (L??rida)	Spain	Spanish
-Le-Cap-Ha??tien	Haiti	Haiti Creole
-La Ceiba	Honduras	Spanish
-Livorno	Italy	Italian
-Latina	Italy	Italian
-Lecce	Italy	Italian
-La Spezia	Italy	Italian
-Linz	Austria	German
-London	Canada	English
-Laval	Canada	English
-Longueuil	Canada	English
-Lanzhou	China	Chinese
-Luoyang	China	Chinese
-Liuzhou	China	Chinese
-Liaoyang	China	Chinese
 Liupanshui	China	Chinese
-Liaoyuan	China	Chinese
 Lianyungang	China	Chinese
-Leshan	China	Chinese
-Linyi	China	Chinese
-Luzhou	China	Chinese
-Laiwu	China	Chinese
-Liaocheng	China	Chinese
-Laizhou	China	Chinese
-Linfen	China	Chinese
 Liangcheng	China	Chinese
-Longkou	China	Chinese
-Langfang	China	Chinese
-Liu??an	China	Chinese
-Longjing	China	Chinese
 Lengshuijiang	China	Chinese
-Laiyang	China	Chinese
-Longyan	China	Chinese
-Linhe	China	Chinese
-Leiyang	China	Chinese
-Loudi	China	Chinese
-Luohe	China	Chinese
-Linqing	China	Chinese
-Laohekou	China	Chinese
-Linchuan	China	Chinese
-Lhasa	China	Chinese
-Lianyuan	China	Chinese
-Liyang	China	Chinese
-Liling	China	Chinese
-Linhai	China	Chinese
-Larisa	Greece	Greek
-La Habana	Cuba	Spanish
-Lilongwe	Malawi	Chichewa
-Le??n	Mexico	Spanish
-La Paz	Mexico	Spanish
-La Paz	Mexico	Spanish
 L??zaro C??rdenas	Mexico	Spanish
 Lagos de Moreno	Mexico	Spanish
-Lerdo	Mexico	Spanish
-Los Cabos	Mexico	Spanish
-Lerma	Mexico	Spanish
 Las Margaritas	Mexico	Spanish
 Lashio (Lasho)	Myanmar	Burmese
 Lalitapur	Nepal	Nepali
-Le??n	Nicaragua	Spanish
-Lambar??	Paraguay	Spanish
-Lima	Peru	Spanish
-Lisboa	Portugal	Portuguese
-L??dz	Poland	Polish
-Lublin	Poland	Polish
-Legnica	Poland	Polish
-Lyon	France	French
-Le Havre	France	French
-Lille	France	French
-Le Mans	France	French
-Limoges	France	French
-Link??ping	Sweden	Swedish
-Lund	Sweden	Swedish
-Leipzig	Germany	German
-L??beck	Germany	German
 Ludwigshafen am Rhein	Germany	German
 Leverkusen	Germany	German
-L??nen	Germany	German
-Lahti	Finland	Finnish
-Lausanne	Switzerland	German
-Latakia	Syria	Arabic
 Luchou	Taiwan	Min
 Lungtan	Taiwan	Min
-Liberec	Czech Republic	Czech
-Lviv	Ukraine	Ukrainian
-Lugansk	Ukraine	Ukrainian
-Lutsk	Ukraine	Ukrainian
-Lysyt?ansk	Ukraine	Ukrainian
 Lower Hutt	New Zealand	English
-Lida	Belarus	Belorussian
 Los Teques	Venezuela	Spanish
-Lipetsk	Russian Federation	Russian
-Ljubertsy	Russian Federation	Russian
 Leninsk-Kuznetski	Russian Federation	Russian
-Long Xuyen	Vietnam	Vietnamese
 Los Angeles	United States	English
-Las Vegas	United States	English
 Long Beach	United States	English
 Lexington-Fayette	United States	English
 Louisville	United States	English
-Lincoln	United States	English
-Lubbock	United States	English
 Little Rock	United States	English
-Laredo	United States	English
-Lakewood	United States	English
-Lansing	United States	English
-Lancaster	United States	English
-Lafayette	United States	English
-Lowell	United States	English
-Livonia	United States	English
 set join_cache_level=3;
 show variables like 'join_cache_level';
 Variable_name	Value
@@ -447,7 +227,8 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	Country	ALL	NULL	NULL	NULL	NULL	239	Using where
 1	SIMPLE	CountryLanguage	hash	NULL	hj_key	3	world.Country.Code	984	Using where; Using join buffer (flat, BNLH join)
@@ -457,148 +238,37 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 Name	Name	Language
-Leiden	Netherlands	Dutch
 La Matanza	Argentina	Spanish
 Lomas de Zamora	Argentina	Spanish
-La Plata	Argentina	Spanish
-Lan??s	Argentina	Spanish
-Las Heras	Argentina	Spanish
-La Rioja	Argentina	Spanish
-Li??ge	Belgium	Dutch
-La Paz	Bolivia	Spanish
-Londrina	Brazil	Portuguese
-Limeira	Brazil	Portuguese
-Lages	Brazil	Portuguese
-Luzi??nia	Brazil	Portuguese
 Lauro de Freitas	Brazil	Portuguese
-Linhares	Brazil	Portuguese
-London	United Kingdom	English
-Liverpool	United Kingdom	English
-Leeds	United Kingdom	English
-Leicester	United Kingdom	English
-Luton	United Kingdom	English
 Los Angeles	Chile	Spanish
-La Serena	Chile	Spanish
-La Romana	Dominican Republic	Spanish
-Loja	Ecuador	Spanish
-Luxor	Egypt	Arabic
 Las Palmas de Gran Canaria	Spain	Spanish
 L??Hospitalet de Llobregat	Spain	Spanish
-Legan??s	Spain	Spanish
-Le??n	Spain	Spanish
-Logro??o	Spain	Spanish
 Lleida (L??rida)	Spain	Spanish
-Le-Cap-Ha??tien	Haiti	Haiti Creole
-La Ceiba	Honduras	Spanish
-Livorno	Italy	Italian
-Latina	Italy	Italian
-Lecce	Italy	Italian
-La Spezia	Italy	Italian
-Linz	Austria	German
-London	Canada	English
-Laval	Canada	English
-Longueuil	Canada	English
-Lanzhou	China	Chinese
-Luoyang	China	Chinese
-Liuzhou	China	Chinese
-Liaoyang	China	Chinese
 Liupanshui	China	Chinese
-Liaoyuan	China	Chinese
 Lianyungang	China	Chinese
-Leshan	China	Chinese
-Linyi	China	Chinese
-Luzhou	China	Chinese
-Laiwu	China	Chinese
-Liaocheng	China	Chinese
-Laizhou	China	Chinese
-Linfen	China	Chinese
 Liangcheng	China	Chinese
-Longkou	China	Chinese
-Langfang	China	Chinese
-Liu??an	China	Chinese
-Longjing	China	Chinese
 Lengshuijiang	China	Chinese
-Laiyang	China	Chinese
-Longyan	China	Chinese
-Linhe	China	Chinese
-Leiyang	China	Chinese
-Loudi	China	Chinese
-Luohe	China	Chinese
-Linqing	China	Chinese
-Laohekou	China	Chinese
-Linchuan	China	Chinese
-Lhasa	China	Chinese
-Lianyuan	China	Chinese
-Liyang	China	Chinese
-Liling	China	Chinese
-Linhai	China	Chinese
-Larisa	Greece	Greek
-La Habana	Cuba	Spanish
-Lilongwe	Malawi	Chichewa
-Le??n	Mexico	Spanish
-La Paz	Mexico	Spanish
-La Paz	Mexico	Spanish
 L??zaro C??rdenas	Mexico	Spanish
 Lagos de Moreno	Mexico	Spanish
-Lerdo	Mexico	Spanish
-Los Cabos	Mexico	Spanish
-Lerma	Mexico	Spanish
 Las Margaritas	Mexico	Spanish
 Lashio (Lasho)	Myanmar	Burmese
 Lalitapur	Nepal	Nepali
-Le??n	Nicaragua	Spanish
-Lambar??	Paraguay	Spanish
-Lima	Peru	Spanish
-Lisboa	Portugal	Portuguese
-L??dz	Poland	Polish
-Lublin	Poland	Polish
-Legnica	Poland	Polish
-Lyon	France	French
-Le Havre	France	French
-Lille	France	French
-Le Mans	France	French
-Limoges	France	French
-Link??ping	Sweden	Swedish
-Lund	Sweden	Swedish
-Leipzig	Germany	German
-L??beck	Germany	German
 Ludwigshafen am Rhein	Germany	German
 Leverkusen	Germany	German
-L??nen	Germany	German
-Lahti	Finland	Finnish
-Lausanne	Switzerland	German
-Latakia	Syria	Arabic
 Luchou	Taiwan	Min
 Lungtan	Taiwan	Min
-Liberec	Czech Republic	Czech
-Lviv	Ukraine	Ukrainian
-Lugansk	Ukraine	Ukrainian
-Lutsk	Ukraine	Ukrainian
-Lysyt?ansk	Ukraine	Ukrainian
 Lower Hutt	New Zealand	English
-Lida	Belarus	Belorussian
 Los Teques	Venezuela	Spanish
-Lipetsk	Russian Federation	Russian
-Ljubertsy	Russian Federation	Russian
 Leninsk-Kuznetski	Russian Federation	Russian
-Long Xuyen	Vietnam	Vietnamese
 Los Angeles	United States	English
-Las Vegas	United States	English
 Long Beach	United States	English
 Lexington-Fayette	United States	English
 Louisville	United States	English
-Lincoln	United States	English
-Lubbock	United States	English
 Little Rock	United States	English
-Laredo	United States	English
-Lakewood	United States	English
-Lansing	United States	English
-Lancaster	United States	English
-Lafayette	United States	English
-Lowell	United States	English
-Livonia	United States	English
 set join_cache_level=4;
 show variables like 'join_cache_level';
 Variable_name	Value
@@ -635,7 +305,8 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	Country	ALL	NULL	NULL	NULL	NULL	239	Using where
 1	SIMPLE	City	hash	NULL	hj_key	3	world.Country.Code	4079	Using where; Using join buffer (flat, BNLH join)
@@ -645,148 +316,37 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 Name	Name	Language
-Leiden	Netherlands	Dutch
 La Matanza	Argentina	Spanish
 Lomas de Zamora	Argentina	Spanish
-La Plata	Argentina	Spanish
-Lan??s	Argentina	Spanish
-Las Heras	Argentina	Spanish
-La Rioja	Argentina	Spanish
-Li??ge	Belgium	Dutch
-La Paz	Bolivia	Spanish
-Londrina	Brazil	Portuguese
-Limeira	Brazil	Portuguese
-Lages	Brazil	Portuguese
-Luzi??nia	Brazil	Portuguese
 Lauro de Freitas	Brazil	Portuguese
-Linhares	Brazil	Portuguese
-London	United Kingdom	English
-Liverpool	United Kingdom	English
-Leeds	United Kingdom	English
-Leicester	United Kingdom	English
-Luton	United Kingdom	English
 Los Angeles	Chile	Spanish
-La Serena	Chile	Spanish
-La Romana	Dominican Republic	Spanish
-Loja	Ecuador	Spanish
-Luxor	Egypt	Arabic
 Las Palmas de Gran Canaria	Spain	Spanish
 L??Hospitalet de Llobregat	Spain	Spanish
-Legan??s	Spain	Spanish
-Le??n	Spain	Spanish
-Logro??o	Spain	Spanish
 Lleida (L??rida)	Spain	Spanish
-Le-Cap-Ha??tien	Haiti	Haiti Creole
-La Ceiba	Honduras	Spanish
-Livorno	Italy	Italian
-Latina	Italy	Italian
-Lecce	Italy	Italian
-La Spezia	Italy	Italian
-Linz	Austria	German
-London	Canada	English
-Laval	Canada	English
-Longueuil	Canada	English
-Lanzhou	China	Chinese
-Luoyang	China	Chinese
-Liuzhou	China	Chinese
-Liaoyang	China	Chinese
 Liupanshui	China	Chinese
-Liaoyuan	China	Chinese
 Lianyungang	China	Chinese
-Leshan	China	Chinese
-Linyi	China	Chinese
-Luzhou	China	Chinese
-Laiwu	China	Chinese
-Liaocheng	China	Chinese
-Laizhou	China	Chinese
-Linfen	China	Chinese
 Liangcheng	China	Chinese
-Longkou	China	Chinese
-Langfang	China	Chinese
-Liu??an	China	Chinese
-Longjing	China	Chinese
 Lengshuijiang	China	Chinese
-Laiyang	China	Chinese
-Longyan	China	Chinese
-Linhe	China	Chinese
-Leiyang	China	Chinese
-Loudi	China	Chinese
-Luohe	China	Chinese
-Linqing	China	Chinese
-Laohekou	China	Chinese
-Linchuan	China	Chinese
-Lhasa	China	Chinese
-Lianyuan	China	Chinese
-Liyang	China	Chinese
-Liling	China	Chinese
-Linhai	China	Chinese
-Larisa	Greece	Greek
-La Habana	Cuba	Spanish
-Lilongwe	Malawi	Chichewa
-Le??n	Mexico	Spanish
-La Paz	Mexico	Spanish
-La Paz	Mexico	Spanish
 L??zaro C??rdenas	Mexico	Spanish
 Lagos de Moreno	Mexico	Spanish
-Lerdo	Mexico	Spanish
-Los Cabos	Mexico	Spanish
-Lerma	Mexico	Spanish
 Las Margaritas	Mexico	Spanish
 Lashio (Lasho)	Myanmar	Burmese
 Lalitapur	Nepal	Nepali
-Le??n	Nicaragua	Spanish
-Lambar??	Paraguay	Spanish
-Lima	Peru	Spanish
-Lisboa	Portugal	Portuguese
-L??dz	Poland	Polish
-Lublin	Poland	Polish
-Legnica	Poland	Polish
-Lyon	France	French
-Le Havre	France	French
-Lille	France	French
-Le Mans	France	French
-Limoges	France	French
-Link??ping	Sweden	Swedish
-Lund	Sweden	Swedish
-Leipzig	Germany	German
-L??beck	Germany	German
 Ludwigshafen am Rhein	Germany	German
 Leverkusen	Germany	German
-L??nen	Germany	German
-Lahti	Finland	Finnish
-Lausanne	Switzerland	German
-Latakia	Syria	Arabic
 Luchou	Taiwan	Min
 Lungtan	Taiwan	Min
-Liberec	Czech Republic	Czech
-Lviv	Ukraine	Ukrainian
-Lugansk	Ukraine	Ukrainian
-Lutsk	Ukraine	Ukrainian
-Lysyt?ansk	Ukraine	Ukrainian
 Lower Hutt	New Zealand	English
-Lida	Belarus	Belorussian
 Los Teques	Venezuela	Spanish
-Lipetsk	Russian Federation	Russian
-Ljubertsy	Russian Federation	Russian
 Leninsk-Kuznetski	Russian Federation	Russian
-Long Xuyen	Vietnam	Vietnamese
 Los Angeles	United States	English
-Las Vegas	United States	English
 Long Beach	United States	English
 Lexington-Fayette	United States	English
 Louisville	United States	English
-Lincoln	United States	English
-Lubbock	United States	English
 Little Rock	United States	English
-Laredo	United States	English
-Lakewood	United States	English
-Lansing	United States	English
-Lancaster	United States	English
-Lafayette	United States	English
-Lowell	United States	English
-Livonia	United States	English
 set join_cache_level=default;
 set join_buffer_size=256;
 show variables like 'join_buffer_size';
@@ -827,7 +387,8 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	Country	ALL	NULL	NULL	NULL	NULL	239	Using where
 1	SIMPLE	City	ALL	NULL	NULL	NULL	NULL	4079	Using where; Using join buffer (flat, BNL join)
@@ -837,148 +398,37 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 Name	Name	Language
-Leiden	Netherlands	Dutch
 La Matanza	Argentina	Spanish
 Lomas de Zamora	Argentina	Spanish
-La Plata	Argentina	Spanish
-Lan??s	Argentina	Spanish
-Las Heras	Argentina	Spanish
-La Rioja	Argentina	Spanish
-Li??ge	Belgium	Dutch
-La Paz	Bolivia	Spanish
-Londrina	Brazil	Portuguese
-Limeira	Brazil	Portuguese
-Lages	Brazil	Portuguese
-Luzi??nia	Brazil	Portuguese
 Lauro de Freitas	Brazil	Portuguese
-Linhares	Brazil	Portuguese
-London	United Kingdom	English
-Liverpool	United Kingdom	English
-Leeds	United Kingdom	English
-Leicester	United Kingdom	English
-Luton	United Kingdom	English
 Los Angeles	Chile	Spanish
-La Serena	Chile	Spanish
-La Romana	Dominican Republic	Spanish
-Loja	Ecuador	Spanish
-Luxor	Egypt	Arabic
 Las Palmas de Gran Canaria	Spain	Spanish
 L??Hospitalet de Llobregat	Spain	Spanish
-Legan??s	Spain	Spanish
-Le??n	Spain	Spanish
-Logro??o	Spain	Spanish
 Lleida (L??rida)	Spain	Spanish
-Le-Cap-Ha??tien	Haiti	Haiti Creole
-La Ceiba	Honduras	Spanish
-Livorno	Italy	Italian
-Latina	Italy	Italian
-Lecce	Italy	Italian
-La Spezia	Italy	Italian
-Linz	Austria	German
-London	Canada	English
-Laval	Canada	English
-Longueuil	Canada	English
-Lanzhou	China	Chinese
-Luoyang	China	Chinese
-Liuzhou	China	Chinese
-Liaoyang	China	Chinese
 Liupanshui	China	Chinese
-Liaoyuan	China	Chinese
 Lianyungang	China	Chinese
-Leshan	China	Chinese
-Linyi	China	Chinese
-Luzhou	China	Chinese
-Laiwu	China	Chinese
-Liaocheng	China	Chinese
-Laizhou	China	Chinese
-Linfen	China	Chinese
 Liangcheng	China	Chinese
-Longkou	China	Chinese
-Langfang	China	Chinese
-Liu??an	China	Chinese
-Longjing	China	Chinese
 Lengshuijiang	China	Chinese
-Laiyang	China	Chinese
-Longyan	China	Chinese
-Linhe	China	Chinese
-Leiyang	China	Chinese
-Loudi	China	Chinese
-Luohe	China	Chinese
-Linqing	China	Chinese
-Laohekou	China	Chinese
-Linchuan	China	Chinese
-Lhasa	China	Chinese
-Lianyuan	China	Chinese
-Liyang	China	Chinese
-Liling	China	Chinese
-Linhai	China	Chinese
-Larisa	Greece	Greek
-La Habana	Cuba	Spanish
-Lilongwe	Malawi	Chichewa
-Le??n	Mexico	Spanish
-La Paz	Mexico	Spanish
-La Paz	Mexico	Spanish
 L??zaro C??rdenas	Mexico	Spanish
 Lagos de Moreno	Mexico	Spanish
-Lerdo	Mexico	Spanish
-Los Cabos	Mexico	Spanish
-Lerma	Mexico	Spanish
 Las Margaritas	Mexico	Spanish
 Lashio (Lasho)	Myanmar	Burmese
 Lalitapur	Nepal	Nepali
-Le??n	Nicaragua	Spanish
-Lambar??	Paraguay	Spanish
-Lima	Peru	Spanish
-Lisboa	Portugal	Portuguese
-L??dz	Poland	Polish
-Lublin	Poland	Polish
-Legnica	Poland	Polish
-Lyon	France	French
-Le Havre	France	French
-Lille	France	French
-Le Mans	France	French
-Limoges	France	French
-Link??ping	Sweden	Swedish
-Lund	Sweden	Swedish
-Leipzig	Germany	German
-L??beck	Germany	German
 Ludwigshafen am Rhein	Germany	German
 Leverkusen	Germany	German
-L??nen	Germany	German
-Lahti	Finland	Finnish
-Lausanne	Switzerland	German
-Latakia	Syria	Arabic
 Luchou	Taiwan	Min
 Lungtan	Taiwan	Min
-Liberec	Czech Republic	Czech
-Lviv	Ukraine	Ukrainian
-Lugansk	Ukraine	Ukrainian
-Lutsk	Ukraine	Ukrainian
-Lysyt?ansk	Ukraine	Ukrainian
 Lower Hutt	New Zealand	English
-Lida	Belarus	Belorussian
 Los Teques	Venezuela	Spanish
-Lipetsk	Russian Federation	Russian
-Ljubertsy	Russian Federation	Russian
 Leninsk-Kuznetski	Russian Federation	Russian
-Long Xuyen	Vietnam	Vietnamese
 Los Angeles	United States	English
-Las Vegas	United States	English
 Long Beach	United States	English
 Lexington-Fayette	United States	English
 Louisville	United States	English
-Lincoln	United States	English
-Lubbock	United States	English
 Little Rock	United States	English
-Laredo	United States	English
-Lakewood	United States	English
-Lansing	United States	English
-Lancaster	United States	English
-Lafayette	United States	English
-Lowell	United States	English
-Livonia	United States	English
 set join_cache_level=2;
 show variables like 'join_cache_level';
 Variable_name	Value
@@ -1015,7 +465,8 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	Country	ALL	NULL	NULL	NULL	NULL	239	Using where
 1	SIMPLE	City	ALL	NULL	NULL	NULL	NULL	4079	Using where; Using join buffer (flat, BNL join)
@@ -1025,148 +476,37 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 Name	Name	Language
-Leiden	Netherlands	Dutch
 La Matanza	Argentina	Spanish
 Lomas de Zamora	Argentina	Spanish
-La Plata	Argentina	Spanish
-Lan??s	Argentina	Spanish
-Las Heras	Argentina	Spanish
-La Rioja	Argentina	Spanish
-Li??ge	Belgium	Dutch
-La Paz	Bolivia	Spanish
-Londrina	Brazil	Portuguese
-Limeira	Brazil	Portuguese
-Lages	Brazil	Portuguese
-Luzi??nia	Brazil	Portuguese
 Lauro de Freitas	Brazil	Portuguese
-Linhares	Brazil	Portuguese
-London	United Kingdom	English
-Liverpool	United Kingdom	English
-Leeds	United Kingdom	English
-Leicester	United Kingdom	English
-Luton	United Kingdom	English
 Los Angeles	Chile	Spanish
-La Serena	Chile	Spanish
-La Romana	Dominican Republic	Spanish
-Loja	Ecuador	Spanish
-Luxor	Egypt	Arabic
 Las Palmas de Gran Canaria	Spain	Spanish
 L??Hospitalet de Llobregat	Spain	Spanish
-Legan??s	Spain	Spanish
-Le??n	Spain	Spanish
-Logro??o	Spain	Spanish
 Lleida (L??rida)	Spain	Spanish
-Le-Cap-Ha??tien	Haiti	Haiti Creole
-La Ceiba	Honduras	Spanish
-Livorno	Italy	Italian
-Latina	Italy	Italian
-Lecce	Italy	Italian
-La Spezia	Italy	Italian
-Linz	Austria	German
-London	Canada	English
-Laval	Canada	English
-Longueuil	Canada	English
-Lanzhou	China	Chinese
-Luoyang	China	Chinese
-Liuzhou	China	Chinese
-Liaoyang	China	Chinese
 Liupanshui	China	Chinese
-Liaoyuan	China	Chinese
 Lianyungang	China	Chinese
-Leshan	China	Chinese
-Linyi	China	Chinese
-Luzhou	China	Chinese
-Laiwu	China	Chinese
-Liaocheng	China	Chinese
-Laizhou	China	Chinese
-Linfen	China	Chinese
 Liangcheng	China	Chinese
-Longkou	China	Chinese
-Langfang	China	Chinese
-Liu??an	China	Chinese
-Longjing	China	Chinese
 Lengshuijiang	China	Chinese
-Laiyang	China	Chinese
-Longyan	China	Chinese
-Linhe	China	Chinese
-Leiyang	China	Chinese
-Loudi	China	Chinese
-Luohe	China	Chinese
-Linqing	China	Chinese
-Laohekou	China	Chinese
-Linchuan	China	Chinese
-Lhasa	China	Chinese
-Lianyuan	China	Chinese
-Liyang	China	Chinese
-Liling	China	Chinese
-Linhai	China	Chinese
-Larisa	Greece	Greek
-La Habana	Cuba	Spanish
-Lilongwe	Malawi	Chichewa
-Le??n	Mexico	Spanish
-La Paz	Mexico	Spanish
-La Paz	Mexico	Spanish
 L??zaro C??rdenas	Mexico	Spanish
 Lagos de Moreno	Mexico	Spanish
-Lerdo	Mexico	Spanish
-Los Cabos	Mexico	Spanish
-Lerma	Mexico	Spanish
 Las Margaritas	Mexico	Spanish
 Lashio (Lasho)	Myanmar	Burmese
 Lalitapur	Nepal	Nepali
-Le??n	Nicaragua	Spanish
-Lambar??	Paraguay	Spanish
-Lima	Peru	Spanish
-Lisboa	Portugal	Portuguese
-L??dz	Poland	Polish
-Lublin	Poland	Polish
-Legnica	Poland	Polish
-Lyon	France	French
-Le Havre	France	French
-Lille	France	French
-Le Mans	France	French
-Limoges	France	French
-Link??ping	Sweden	Swedish
-Lund	Sweden	Swedish
-Leipzig	Germany	German
-L??beck	Germany	German
 Ludwigshafen am Rhein	Germany	German
 Leverkusen	Germany	German
-L??nen	Germany	German
-Lahti	Finland	Finnish
-Lausanne	Switzerland	German
-Latakia	Syria	Arabic
 Luchou	Taiwan	Min
 Lungtan	Taiwan	Min
-Liberec	Czech Republic	Czech
-Lviv	Ukraine	Ukrainian
-Lugansk	Ukraine	Ukrainian
-Lutsk	Ukraine	Ukrainian
-Lysyt?ansk	Ukraine	Ukrainian
 Lower Hutt	New Zealand	English
-Lida	Belarus	Belorussian
 Los Teques	Venezuela	Spanish
-Lipetsk	Russian Federation	Russian
-Ljubertsy	Russian Federation	Russian
 Leninsk-Kuznetski	Russian Federation	Russian
-Long Xuyen	Vietnam	Vietnamese
 Los Angeles	United States	English
-Las Vegas	United States	English
 Long Beach	United States	English
 Lexington-Fayette	United States	English
 Louisville	United States	English
-Lincoln	United States	English
-Lubbock	United States	English
 Little Rock	United States	English
-Laredo	United States	English
-Lakewood	United States	English
-Lansing	United States	English
-Lancaster	United States	English
-Lafayette	United States	English
-Lowell	United States	English
-Livonia	United States	English
 set join_cache_level=3;
 show variables like 'join_cache_level';
 Variable_name	Value
@@ -1203,7 +543,8 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	Country	ALL	NULL	NULL	NULL	NULL	239	Using where
 1	SIMPLE	City	hash	NULL	hj_key	3	world.Country.Code	4079	Using where; Using join buffer (flat, BNLH join)
@@ -1213,148 +554,37 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 Name	Name	Language
-Leiden	Netherlands	Dutch
 La Matanza	Argentina	Spanish
 Lomas de Zamora	Argentina	Spanish
-La Plata	Argentina	Spanish
-Lan??s	Argentina	Spanish
-Las Heras	Argentina	Spanish
-La Rioja	Argentina	Spanish
-Li??ge	Belgium	Dutch
-La Paz	Bolivia	Spanish
-Londrina	Brazil	Portuguese
-Limeira	Brazil	Portuguese
-Lages	Brazil	Portuguese
-Luzi??nia	Brazil	Portuguese
 Lauro de Freitas	Brazil	Portuguese
-Linhares	Brazil	Portuguese
-London	United Kingdom	English
-Liverpool	United Kingdom	English
-Leeds	United Kingdom	English
-Leicester	United Kingdom	English
-Luton	United Kingdom	English
 Los Angeles	Chile	Spanish
-La Serena	Chile	Spanish
-La Romana	Dominican Republic	Spanish
-Loja	Ecuador	Spanish
-Luxor	Egypt	Arabic
 Las Palmas de Gran Canaria	Spain	Spanish
 L??Hospitalet de Llobregat	Spain	Spanish
-Legan??s	Spain	Spanish
-Le??n	Spain	Spanish
-Logro??o	Spain	Spanish
 Lleida (L??rida)	Spain	Spanish
-Le-Cap-Ha??tien	Haiti	Haiti Creole
-La Ceiba	Honduras	Spanish
-Livorno	Italy	Italian
-Latina	Italy	Italian
-Lecce	Italy	Italian
-La Spezia	Italy	Italian
-Linz	Austria	German
-London	Canada	English
-Laval	Canada	English
-Longueuil	Canada	English
-Lanzhou	China	Chinese
-Luoyang	China	Chinese
-Liuzhou	China	Chinese
-Liaoyang	China	Chinese
 Liupanshui	China	Chinese
-Liaoyuan	China	Chinese
 Lianyungang	China	Chinese
-Leshan	China	Chinese
-Linyi	China	Chinese
-Luzhou	China	Chinese
-Laiwu	China	Chinese
-Liaocheng	China	Chinese
-Laizhou	China	Chinese
-Linfen	China	Chinese
 Liangcheng	China	Chinese
-Longkou	China	Chinese
-Langfang	China	Chinese
-Liu??an	China	Chinese
-Longjing	China	Chinese
 Lengshuijiang	China	Chinese
-Laiyang	China	Chinese
-Longyan	China	Chinese
-Linhe	China	Chinese
-Leiyang	China	Chinese
-Loudi	China	Chinese
-Luohe	China	Chinese
-Linqing	China	Chinese
-Laohekou	China	Chinese
-Linchuan	China	Chinese
-Lhasa	China	Chinese
-Lianyuan	China	Chinese
-Liyang	China	Chinese
-Liling	China	Chinese
-Linhai	China	Chinese
-Larisa	Greece	Greek
-La Habana	Cuba	Spanish
-Lilongwe	Malawi	Chichewa
-Le??n	Mexico	Spanish
-La Paz	Mexico	Spanish
-La Paz	Mexico	Spanish
 L??zaro C??rdenas	Mexico	Spanish
 Lagos de Moreno	Mexico	Spanish
-Lerdo	Mexico	Spanish
-Los Cabos	Mexico	Spanish
-Lerma	Mexico	Spanish
 Las Margaritas	Mexico	Spanish
 Lashio (Lasho)	Myanmar	Burmese
 Lalitapur	Nepal	Nepali
-Le??n	Nicaragua	Spanish
-Lambar??	Paraguay	Spanish
-Lima	Peru	Spanish
-Lisboa	Portugal	Portuguese
-L??dz	Poland	Polish
-Lublin	Poland	Polish
-Legnica	Poland	Polish
-Lyon	France	French
-Le Havre	France	French
-Lille	France	French
-Le Mans	France	French
-Limoges	France	French
-Link??ping	Sweden	Swedish
-Lund	Sweden	Swedish
-Leipzig	Germany	German
-L??beck	Germany	German
 Ludwigshafen am Rhein	Germany	German
 Leverkusen	Germany	German
-L??nen	Germany	German
-Lahti	Finland	Finnish
-Lausanne	Switzerland	German
-Latakia	Syria	Arabic
 Luchou	Taiwan	Min
 Lungtan	Taiwan	Min
-Liberec	Czech Republic	Czech
-Lviv	Ukraine	Ukrainian
-Lugansk	Ukraine	Ukrainian
-Lutsk	Ukraine	Ukrainian
-Lysyt?ansk	Ukraine	Ukrainian
 Lower Hutt	New Zealand	English
-Lida	Belarus	Belorussian
 Los Teques	Venezuela	Spanish
-Lipetsk	Russian Federation	Russian
-Ljubertsy	Russian Federation	Russian
 Leninsk-Kuznetski	Russian Federation	Russian
-Long Xuyen	Vietnam	Vietnamese
 Los Angeles	United States	English
-Las Vegas	United States	English
 Long Beach	United States	English
 Lexington-Fayette	United States	English
 Louisville	United States	English
-Lincoln	United States	English
-Lubbock	United States	English
 Little Rock	United States	English
-Laredo	United States	English
-Lakewood	United States	English
-Lansing	United States	English
-Lancaster	United States	English
-Lafayette	United States	English
-Lowell	United States	English
-Livonia	United States	English
 set join_cache_level=4;
 show variables like 'join_cache_level';
 Variable_name	Value
@@ -1391,7 +621,8 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	Country	ALL	NULL	NULL	NULL	NULL	239	Using where
 1	SIMPLE	City	hash	NULL	hj_key	3	world.Country.Code	4079	Using where; Using join buffer (flat, BNLH join)
@@ -1401,148 +632,37 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 Name	Name	Language
-Leiden	Netherlands	Dutch
 La Matanza	Argentina	Spanish
 Lomas de Zamora	Argentina	Spanish
-La Plata	Argentina	Spanish
-Lan??s	Argentina	Spanish
-Las Heras	Argentina	Spanish
-La Rioja	Argentina	Spanish
-Li??ge	Belgium	Dutch
-La Paz	Bolivia	Spanish
-Londrina	Brazil	Portuguese
-Limeira	Brazil	Portuguese
-Lages	Brazil	Portuguese
-Luzi??nia	Brazil	Portuguese
 Lauro de Freitas	Brazil	Portuguese
-Linhares	Brazil	Portuguese
-London	United Kingdom	English
-Liverpool	United Kingdom	English
-Leeds	United Kingdom	English
-Leicester	United Kingdom	English
-Luton	United Kingdom	English
 Los Angeles	Chile	Spanish
-La Serena	Chile	Spanish
-La Romana	Dominican Republic	Spanish
-Loja	Ecuador	Spanish
-Luxor	Egypt	Arabic
 Las Palmas de Gran Canaria	Spain	Spanish
 L??Hospitalet de Llobregat	Spain	Spanish
-Legan??s	Spain	Spanish
-Le??n	Spain	Spanish
-Logro??o	Spain	Spanish
 Lleida (L??rida)	Spain	Spanish
-Le-Cap-Ha??tien	Haiti	Haiti Creole
-La Ceiba	Honduras	Spanish
-Livorno	Italy	Italian
-Latina	Italy	Italian
-Lecce	Italy	Italian
-La Spezia	Italy	Italian
-Linz	Austria	German
-London	Canada	English
-Laval	Canada	English
-Longueuil	Canada	English
-Lanzhou	China	Chinese
-Luoyang	China	Chinese
-Liuzhou	China	Chinese
-Liaoyang	China	Chinese
 Liupanshui	China	Chinese
-Liaoyuan	China	Chinese
 Lianyungang	China	Chinese
-Leshan	China	Chinese
-Linyi	China	Chinese
-Luzhou	China	Chinese
-Laiwu	China	Chinese
-Liaocheng	China	Chinese
-Laizhou	China	Chinese
-Linfen	China	Chinese
 Liangcheng	China	Chinese
-Longkou	China	Chinese
-Langfang	China	Chinese
-Liu??an	China	Chinese
-Longjing	China	Chinese
 Lengshuijiang	China	Chinese
-Laiyang	China	Chinese
-Longyan	China	Chinese
-Linhe	China	Chinese
-Leiyang	China	Chinese
-Loudi	China	Chinese
-Luohe	China	Chinese
-Linqing	China	Chinese
-Laohekou	China	Chinese
-Linchuan	China	Chinese
-Lhasa	China	Chinese
-Lianyuan	China	Chinese
-Liyang	China	Chinese
-Liling	China	Chinese
-Linhai	China	Chinese
-Larisa	Greece	Greek
-La Habana	Cuba	Spanish
-Lilongwe	Malawi	Chichewa
-Le??n	Mexico	Spanish
-La Paz	Mexico	Spanish
-La Paz	Mexico	Spanish
 L??zaro C??rdenas	Mexico	Spanish
 Lagos de Moreno	Mexico	Spanish
-Lerdo	Mexico	Spanish
-Los Cabos	Mexico	Spanish
-Lerma	Mexico	Spanish
 Las Margaritas	Mexico	Spanish
 Lashio (Lasho)	Myanmar	Burmese
 Lalitapur	Nepal	Nepali
-Le??n	Nicaragua	Spanish
-Lambar??	Paraguay	Spanish
-Lima	Peru	Spanish
-Lisboa	Portugal	Portuguese
-L??dz	Poland	Polish
-Lublin	Poland	Polish
-Legnica	Poland	Polish
-Lyon	France	French
-Le Havre	France	French
-Lille	France	French
-Le Mans	France	French
-Limoges	France	French
-Link??ping	Sweden	Swedish
-Lund	Sweden	Swedish
-Leipzig	Germany	German
-L??beck	Germany	German
 Ludwigshafen am Rhein	Germany	German
 Leverkusen	Germany	German
-L??nen	Germany	German
-Lahti	Finland	Finnish
-Lausanne	Switzerland	German
-Latakia	Syria	Arabic
 Luchou	Taiwan	Min
 Lungtan	Taiwan	Min
-Liberec	Czech Republic	Czech
-Lviv	Ukraine	Ukrainian
-Lugansk	Ukraine	Ukrainian
-Lutsk	Ukraine	Ukrainian
-Lysyt?ansk	Ukraine	Ukrainian
 Lower Hutt	New Zealand	English
-Lida	Belarus	Belorussian
 Los Teques	Venezuela	Spanish
-Lipetsk	Russian Federation	Russian
-Ljubertsy	Russian Federation	Russian
 Leninsk-Kuznetski	Russian Federation	Russian
-Long Xuyen	Vietnam	Vietnamese
 Los Angeles	United States	English
-Las Vegas	United States	English
 Long Beach	United States	English
 Lexington-Fayette	United States	English
 Louisville	United States	English
-Lincoln	United States	English
-Lubbock	United States	English
 Little Rock	United States	English
-Laredo	United States	English
-Lakewood	United States	English
-Lansing	United States	English
-Lancaster	United States	English
-Lafayette	United States	English
-Lowell	United States	English
-Livonia	United States	English
 set join_cache_level=default;
 set join_buffer_size=default;
 show variables like 'join_buffer_size';
@@ -1618,7 +738,8 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	CountryLanguage	ALL	PRIMARY,Percentage	NULL	NULL	NULL	984	Using where
 1	SIMPLE	Country	hash	PRIMARY	PRIMARY	3	world.CountryLanguage.Country	239	Using where; Using join buffer (flat, BNLH join)
@@ -1628,148 +749,37 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 Name	Name	Language
-Leiden	Netherlands	Dutch
 La Matanza	Argentina	Spanish
 Lomas de Zamora	Argentina	Spanish
-La Plata	Argentina	Spanish
-Lan??s	Argentina	Spanish
-Las Heras	Argentina	Spanish
-La Rioja	Argentina	Spanish
-Li??ge	Belgium	Dutch
-La Paz	Bolivia	Spanish
-Londrina	Brazil	Portuguese
-Limeira	Brazil	Portuguese
-Lages	Brazil	Portuguese
-Luzi??nia	Brazil	Portuguese
 Lauro de Freitas	Brazil	Portuguese
-Linhares	Brazil	Portuguese
-London	United Kingdom	English
-Liverpool	United Kingdom	English
-Leeds	United Kingdom	English
-Leicester	United Kingdom	English
-Luton	United Kingdom	English
 Los Angeles	Chile	Spanish
-La Serena	Chile	Spanish
-La Romana	Dominican Republic	Spanish
-Loja	Ecuador	Spanish
-Luxor	Egypt	Arabic
 Las Palmas de Gran Canaria	Spain	Spanish
 L??Hospitalet de Llobregat	Spain	Spanish
-Legan??s	Spain	Spanish
-Le??n	Spain	Spanish
-Logro??o	Spain	Spanish
 Lleida (L??rida)	Spain	Spanish
-Le-Cap-Ha??tien	Haiti	Haiti Creole
-La Ceiba	Honduras	Spanish
-Livorno	Italy	Italian
-Latina	Italy	Italian
-Lecce	Italy	Italian
-La Spezia	Italy	Italian
-Linz	Austria	German
-London	Canada	English
-Laval	Canada	English
-Longueuil	Canada	English
-Lanzhou	China	Chinese
-Luoyang	China	Chinese
-Liuzhou	China	Chinese
-Liaoyang	China	Chinese
 Liupanshui	China	Chinese
-Liaoyuan	China	Chinese
 Lianyungang	China	Chinese
-Leshan	China	Chinese
-Linyi	China	Chinese
-Luzhou	China	Chinese
-Laiwu	China	Chinese
-Liaocheng	China	Chinese
-Laizhou	China	Chinese
-Linfen	China	Chinese
 Liangcheng	China	Chinese
-Longkou	China	Chinese
-Langfang	China	Chinese
-Liu??an	China	Chinese
-Longjing	China	Chinese
 Lengshuijiang	China	Chinese
-Laiyang	China	Chinese
-Longyan	China	Chinese
-Linhe	China	Chinese
-Leiyang	China	Chinese
-Loudi	China	Chinese
-Luohe	China	Chinese
-Linqing	China	Chinese
-Laohekou	China	Chinese
-Linchuan	China	Chinese
-Lhasa	China	Chinese
-Lianyuan	China	Chinese
-Liyang	China	Chinese
-Liling	China	Chinese
-Linhai	China	Chinese
-Larisa	Greece	Greek
-La Habana	Cuba	Spanish
-Lilongwe	Malawi	Chichewa
-Le??n	Mexico	Spanish
-La Paz	Mexico	Spanish
-La Paz	Mexico	Spanish
 L??zaro C??rdenas	Mexico	Spanish
 Lagos de Moreno	Mexico	Spanish
-Lerdo	Mexico	Spanish
-Los Cabos	Mexico	Spanish
-Lerma	Mexico	Spanish
 Las Margaritas	Mexico	Spanish
 Lashio (Lasho)	Myanmar	Burmese
 Lalitapur	Nepal	Nepali
-Le??n	Nicaragua	Spanish
-Lambar??	Paraguay	Spanish
-Lima	Peru	Spanish
-Lisboa	Portugal	Portuguese
-L??dz	Poland	Polish
-Lublin	Poland	Polish
-Legnica	Poland	Polish
-Lyon	France	French
-Le Havre	France	French
-Lille	France	French
-Le Mans	France	French
-Limoges	France	French
-Link??ping	Sweden	Swedish
-Lund	Sweden	Swedish
-Leipzig	Germany	German
-L??beck	Germany	German
 Ludwigshafen am Rhein	Germany	German
 Leverkusen	Germany	German
-L??nen	Germany	German
-Lahti	Finland	Finnish
-Lausanne	Switzerland	German
-Latakia	Syria	Arabic
 Luchou	Taiwan	Min
 Lungtan	Taiwan	Min
-Liberec	Czech Republic	Czech
-Lviv	Ukraine	Ukrainian
-Lugansk	Ukraine	Ukrainian
-Lutsk	Ukraine	Ukrainian
-Lysyt?ansk	Ukraine	Ukrainian
 Lower Hutt	New Zealand	English
-Lida	Belarus	Belorussian
 Los Teques	Venezuela	Spanish
-Lipetsk	Russian Federation	Russian
-Ljubertsy	Russian Federation	Russian
 Leninsk-Kuznetski	Russian Federation	Russian
-Long Xuyen	Vietnam	Vietnamese
 Los Angeles	United States	English
-Las Vegas	United States	English
 Long Beach	United States	English
 Lexington-Fayette	United States	English
 Louisville	United States	English
-Lincoln	United States	English
-Lubbock	United States	English
 Little Rock	United States	English
-Laredo	United States	English
-Lakewood	United States	English
-Lansing	United States	English
-Lancaster	United States	English
-Lafayette	United States	English
-Lowell	United States	English
-Livonia	United States	English
 EXPLAIN
 SELECT Name FROM City
 WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND
@@ -1928,7 +938,8 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	CountryLanguage	ALL	PRIMARY,Percentage	NULL	NULL	NULL	984	Using where
 1	SIMPLE	Country	hash	PRIMARY	PRIMARY	3	world.CountryLanguage.Country	239	Using where; Using join buffer (flat, BNLH join)
@@ -1938,148 +949,37 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 Name	Name	Language
-Leiden	Netherlands	Dutch
 La Matanza	Argentina	Spanish
 Lomas de Zamora	Argentina	Spanish
-La Plata	Argentina	Spanish
-Lan??s	Argentina	Spanish
-Las Heras	Argentina	Spanish
-La Rioja	Argentina	Spanish
-Li??ge	Belgium	Dutch
-La Paz	Bolivia	Spanish
-Londrina	Brazil	Portuguese
-Limeira	Brazil	Portuguese
-Lages	Brazil	Portuguese
-Luzi??nia	Brazil	Portuguese
 Lauro de Freitas	Brazil	Portuguese
-Linhares	Brazil	Portuguese
-London	United Kingdom	English
-Liverpool	United Kingdom	English
-Leeds	United Kingdom	English
-Leicester	United Kingdom	English
-Luton	United Kingdom	English
 Los Angeles	Chile	Spanish
-La Serena	Chile	Spanish
-La Romana	Dominican Republic	Spanish
-Loja	Ecuador	Spanish
-Luxor	Egypt	Arabic
 Las Palmas de Gran Canaria	Spain	Spanish
 L??Hospitalet de Llobregat	Spain	Spanish
-Legan??s	Spain	Spanish
-Le??n	Spain	Spanish
-Logro??o	Spain	Spanish
 Lleida (L??rida)	Spain	Spanish
-Le-Cap-Ha??tien	Haiti	Haiti Creole
-La Ceiba	Honduras	Spanish
-Livorno	Italy	Italian
-Latina	Italy	Italian
-Lecce	Italy	Italian
-La Spezia	Italy	Italian
-Linz	Austria	German
-London	Canada	English
-Laval	Canada	English
-Longueuil	Canada	English
-Lanzhou	China	Chinese
-Luoyang	China	Chinese
-Liuzhou	China	Chinese
-Liaoyang	China	Chinese
 Liupanshui	China	Chinese
-Liaoyuan	China	Chinese
 Lianyungang	China	Chinese
-Leshan	China	Chinese
-Linyi	China	Chinese
-Luzhou	China	Chinese
-Laiwu	China	Chinese
-Liaocheng	China	Chinese
-Laizhou	China	Chinese
-Linfen	China	Chinese
 Liangcheng	China	Chinese
-Longkou	China	Chinese
-Langfang	China	Chinese
-Liu??an	China	Chinese
-Longjing	China	Chinese
 Lengshuijiang	China	Chinese
-Laiyang	China	Chinese
-Longyan	China	Chinese
-Linhe	China	Chinese
-Leiyang	China	Chinese
-Loudi	China	Chinese
-Luohe	China	Chinese
-Linqing	China	Chinese
-Laohekou	China	Chinese
-Linchuan	China	Chinese
-Lhasa	China	Chinese
-Lianyuan	China	Chinese
-Liyang	China	Chinese
-Liling	China	Chinese
-Linhai	China	Chinese
-Larisa	Greece	Greek
-La Habana	Cuba	Spanish
-Lilongwe	Malawi	Chichewa
-Le??n	Mexico	Spanish
-La Paz	Mexico	Spanish
-La Paz	Mexico	Spanish
 L??zaro C??rdenas	Mexico	Spanish
 Lagos de Moreno	Mexico	Spanish
-Lerdo	Mexico	Spanish
-Los Cabos	Mexico	Spanish
-Lerma	Mexico	Spanish
 Las Margaritas	Mexico	Spanish
 Lashio (Lasho)	Myanmar	Burmese
 Lalitapur	Nepal	Nepali
-Le??n	Nicaragua	Spanish
-Lambar??	Paraguay	Spanish
-Lima	Peru	Spanish
-Lisboa	Portugal	Portuguese
-L??dz	Poland	Polish
-Lublin	Poland	Polish
-Legnica	Poland	Polish
-Lyon	France	French
-Le Havre	France	French
-Lille	France	French
-Le Mans	France	French
-Limoges	France	French
-Link??ping	Sweden	Swedish
-Lund	Sweden	Swedish
-Leipzig	Germany	German
-L??beck	Germany	German
 Ludwigshafen am Rhein	Germany	German
 Leverkusen	Germany	German
-L??nen	Germany	German
-Lahti	Finland	Finnish
-Lausanne	Switzerland	German
-Latakia	Syria	Arabic
 Luchou	Taiwan	Min
 Lungtan	Taiwan	Min
-Liberec	Czech Republic	Czech
-Lviv	Ukraine	Ukrainian
-Lugansk	Ukraine	Ukrainian
-Lutsk	Ukraine	Ukrainian
-Lysyt?ansk	Ukraine	Ukrainian
 Lower Hutt	New Zealand	English
-Lida	Belarus	Belorussian
 Los Teques	Venezuela	Spanish
-Lipetsk	Russian Federation	Russian
-Ljubertsy	Russian Federation	Russian
 Leninsk-Kuznetski	Russian Federation	Russian
-Long Xuyen	Vietnam	Vietnamese
 Los Angeles	United States	English
-Las Vegas	United States	English
 Long Beach	United States	English
 Lexington-Fayette	United States	English
 Louisville	United States	English
-Lincoln	United States	English
-Lubbock	United States	English
 Little Rock	United States	English
-Laredo	United States	English
-Lakewood	United States	English
-Lansing	United States	English
-Lancaster	United States	English
-Lafayette	United States	English
-Lowell	United States	English
-Livonia	United States	English
 EXPLAIN
 SELECT Name FROM City
 WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND
@@ -2238,7 +1138,8 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	CountryLanguage	ALL	PRIMARY,Percentage	NULL	NULL	NULL	984	Using where
 1	SIMPLE	Country	eq_ref	PRIMARY	PRIMARY	3	world.CountryLanguage.Country	1	Using where; Using join buffer (flat, BKA join)
@@ -2248,148 +1149,37 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 Name	Name	Language
-Leiden	Netherlands	Dutch
 La Matanza	Argentina	Spanish
 Lomas de Zamora	Argentina	Spanish
-La Plata	Argentina	Spanish
-Lan??s	Argentina	Spanish
-Las Heras	Argentina	Spanish
-La Rioja	Argentina	Spanish
-Li??ge	Belgium	Dutch
-La Paz	Bolivia	Spanish
-Londrina	Brazil	Portuguese
-Limeira	Brazil	Portuguese
-Lages	Brazil	Portuguese
-Luzi??nia	Brazil	Portuguese
 Lauro de Freitas	Brazil	Portuguese
-Linhares	Brazil	Portuguese
-London	United Kingdom	English
-Liverpool	United Kingdom	English
-Leeds	United Kingdom	English
-Leicester	United Kingdom	English
-Luton	United Kingdom	English
 Los Angeles	Chile	Spanish
-La Serena	Chile	Spanish
-La Romana	Dominican Republic	Spanish
-Loja	Ecuador	Spanish
-Luxor	Egypt	Arabic
 Las Palmas de Gran Canaria	Spain	Spanish
 L??Hospitalet de Llobregat	Spain	Spanish
-Legan??s	Spain	Spanish
-Le??n	Spain	Spanish
-Logro??o	Spain	Spanish
 Lleida (L??rida)	Spain	Spanish
-Le-Cap-Ha??tien	Haiti	Haiti Creole
-La Ceiba	Honduras	Spanish
-Livorno	Italy	Italian
-Latina	Italy	Italian
-Lecce	Italy	Italian
-La Spezia	Italy	Italian
-Linz	Austria	German
-London	Canada	English
-Laval	Canada	English
-Longueuil	Canada	English
-Lanzhou	China	Chinese
-Luoyang	China	Chinese
-Liuzhou	China	Chinese
-Liaoyang	China	Chinese
 Liupanshui	China	Chinese
-Liaoyuan	China	Chinese
 Lianyungang	China	Chinese
-Leshan	China	Chinese
-Linyi	China	Chinese
-Luzhou	China	Chinese
-Laiwu	China	Chinese
-Liaocheng	China	Chinese
-Laizhou	China	Chinese
-Linfen	China	Chinese
 Liangcheng	China	Chinese
-Longkou	China	Chinese
-Langfang	China	Chinese
-Liu??an	China	Chinese
-Longjing	China	Chinese
 Lengshuijiang	China	Chinese
-Laiyang	China	Chinese
-Longyan	China	Chinese
-Linhe	China	Chinese
-Leiyang	China	Chinese
-Loudi	China	Chinese
-Luohe	China	Chinese
-Linqing	China	Chinese
-Laohekou	China	Chinese
-Linchuan	China	Chinese
-Lhasa	China	Chinese
-Lianyuan	China	Chinese
-Liyang	China	Chinese
-Liling	China	Chinese
-Linhai	China	Chinese
-Larisa	Greece	Greek
-La Habana	Cuba	Spanish
-Lilongwe	Malawi	Chichewa
-Le??n	Mexico	Spanish
-La Paz	Mexico	Spanish
-La Paz	Mexico	Spanish
 L??zaro C??rdenas	Mexico	Spanish
 Lagos de Moreno	Mexico	Spanish
-Lerdo	Mexico	Spanish
-Los Cabos	Mexico	Spanish
-Lerma	Mexico	Spanish
 Las Margaritas	Mexico	Spanish
 Lashio (Lasho)	Myanmar	Burmese
 Lalitapur	Nepal	Nepali
-Le??n	Nicaragua	Spanish
-Lambar??	Paraguay	Spanish
-Lima	Peru	Spanish
-Lisboa	Portugal	Portuguese
-L??dz	Poland	Polish
-Lublin	Poland	Polish
-Legnica	Poland	Polish
-Lyon	France	French
-Le Havre	France	French
-Lille	France	French
-Le Mans	France	French
-Limoges	France	French
-Link??ping	Sweden	Swedish
-Lund	Sweden	Swedish
-Leipzig	Germany	German
-L??beck	Germany	German
 Ludwigshafen am Rhein	Germany	German
 Leverkusen	Germany	German
-L??nen	Germany	German
-Lahti	Finland	Finnish
-Lausanne	Switzerland	German
-Latakia	Syria	Arabic
 Luchou	Taiwan	Min
 Lungtan	Taiwan	Min
-Liberec	Czech Republic	Czech
-Lviv	Ukraine	Ukrainian
-Lugansk	Ukraine	Ukrainian
-Lutsk	Ukraine	Ukrainian
-Lysyt?ansk	Ukraine	Ukrainian
 Lower Hutt	New Zealand	English
-Lida	Belarus	Belorussian
 Los Teques	Venezuela	Spanish
-Lipetsk	Russian Federation	Russian
-Ljubertsy	Russian Federation	Russian
 Leninsk-Kuznetski	Russian Federation	Russian
-Long Xuyen	Vietnam	Vietnamese
 Los Angeles	United States	English
-Las Vegas	United States	English
 Long Beach	United States	English
 Lexington-Fayette	United States	English
 Louisville	United States	English
-Lincoln	United States	English
-Lubbock	United States	English
 Little Rock	United States	English
-Laredo	United States	English
-Lakewood	United States	English
-Lansing	United States	English
-Lancaster	United States	English
-Lafayette	United States	English
-Lowell	United States	English
-Livonia	United States	English
 EXPLAIN
 SELECT Name FROM City
 WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND
@@ -2545,7 +1335,8 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	CountryLanguage	ALL	PRIMARY,Percentage	NULL	NULL	NULL	984	Using where
 1	SIMPLE	Country	eq_ref	PRIMARY	PRIMARY	3	world.CountryLanguage.Country	1	Using where; Using join buffer (flat, BKA join)
@@ -2555,148 +1346,37 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 Name	Name	Language
-Leiden	Netherlands	Dutch
 La Matanza	Argentina	Spanish
 Lomas de Zamora	Argentina	Spanish
-La Plata	Argentina	Spanish
-Lan??s	Argentina	Spanish
-Las Heras	Argentina	Spanish
-La Rioja	Argentina	Spanish
-Li??ge	Belgium	Dutch
-La Paz	Bolivia	Spanish
-Londrina	Brazil	Portuguese
-Limeira	Brazil	Portuguese
-Lages	Brazil	Portuguese
-Luzi??nia	Brazil	Portuguese
 Lauro de Freitas	Brazil	Portuguese
-Linhares	Brazil	Portuguese
-London	United Kingdom	English
-Liverpool	United Kingdom	English
-Leeds	United Kingdom	English
-Leicester	United Kingdom	English
-Luton	United Kingdom	English
 Los Angeles	Chile	Spanish
-La Serena	Chile	Spanish
-La Romana	Dominican Republic	Spanish
-Loja	Ecuador	Spanish
-Luxor	Egypt	Arabic
 Las Palmas de Gran Canaria	Spain	Spanish
 L??Hospitalet de Llobregat	Spain	Spanish
-Legan??s	Spain	Spanish
-Le??n	Spain	Spanish
-Logro??o	Spain	Spanish
 Lleida (L??rida)	Spain	Spanish
-Le-Cap-Ha??tien	Haiti	Haiti Creole
-La Ceiba	Honduras	Spanish
-Livorno	Italy	Italian
-Latina	Italy	Italian
-Lecce	Italy	Italian
-La Spezia	Italy	Italian
-Linz	Austria	German
-London	Canada	English
-Laval	Canada	English
-Longueuil	Canada	English
-Lanzhou	China	Chinese
-Luoyang	China	Chinese
-Liuzhou	China	Chinese
-Liaoyang	China	Chinese
 Liupanshui	China	Chinese
-Liaoyuan	China	Chinese
 Lianyungang	China	Chinese
-Leshan	China	Chinese
-Linyi	China	Chinese
-Luzhou	China	Chinese
-Laiwu	China	Chinese
-Liaocheng	China	Chinese
-Laizhou	China	Chinese
-Linfen	China	Chinese
 Liangcheng	China	Chinese
-Longkou	China	Chinese
-Langfang	China	Chinese
-Liu??an	China	Chinese
-Longjing	China	Chinese
 Lengshuijiang	China	Chinese
-Laiyang	China	Chinese
-Longyan	China	Chinese
-Linhe	China	Chinese
-Leiyang	China	Chinese
-Loudi	China	Chinese
-Luohe	China	Chinese
-Linqing	China	Chinese
-Laohekou	China	Chinese
-Linchuan	China	Chinese
-Lhasa	China	Chinese
-Lianyuan	China	Chinese
-Liyang	China	Chinese
-Liling	China	Chinese
-Linhai	China	Chinese
-Larisa	Greece	Greek
-La Habana	Cuba	Spanish
-Lilongwe	Malawi	Chichewa
-Le??n	Mexico	Spanish
-La Paz	Mexico	Spanish
-La Paz	Mexico	Spanish
 L??zaro C??rdenas	Mexico	Spanish
 Lagos de Moreno	Mexico	Spanish
-Lerdo	Mexico	Spanish
-Los Cabos	Mexico	Spanish
-Lerma	Mexico	Spanish
 Las Margaritas	Mexico	Spanish
 Lashio (Lasho)	Myanmar	Burmese
 Lalitapur	Nepal	Nepali
-Le??n	Nicaragua	Spanish
-Lambar??	Paraguay	Spanish
-Lima	Peru	Spanish
-Lisboa	Portugal	Portuguese
-L??dz	Poland	Polish
-Lublin	Poland	Polish
-Legnica	Poland	Polish
-Lyon	France	French
-Le Havre	France	French
-Lille	France	French
-Le Mans	France	French
-Limoges	France	French
-Link??ping	Sweden	Swedish
-Lund	Sweden	Swedish
-Leipzig	Germany	German
-L??beck	Germany	German
 Ludwigshafen am Rhein	Germany	German
 Leverkusen	Germany	German
-L??nen	Germany	German
-Lahti	Finland	Finnish
-Lausanne	Switzerland	German
-Latakia	Syria	Arabic
 Luchou	Taiwan	Min
 Lungtan	Taiwan	Min
-Liberec	Czech Republic	Czech
-Lviv	Ukraine	Ukrainian
-Lugansk	Ukraine	Ukrainian
-Lutsk	Ukraine	Ukrainian
-Lysyt?ansk	Ukraine	Ukrainian
 Lower Hutt	New Zealand	English
-Lida	Belarus	Belorussian
 Los Teques	Venezuela	Spanish
-Lipetsk	Russian Federation	Russian
-Ljubertsy	Russian Federation	Russian
 Leninsk-Kuznetski	Russian Federation	Russian
-Long Xuyen	Vietnam	Vietnamese
 Los Angeles	United States	English
-Las Vegas	United States	English
 Long Beach	United States	English
 Lexington-Fayette	United States	English
 Louisville	United States	English
-Lincoln	United States	English
-Lubbock	United States	English
 Little Rock	United States	English
-Laredo	United States	English
-Lakewood	United States	English
-Lansing	United States	English
-Lancaster	United States	English
-Lafayette	United States	English
-Lowell	United States	English
-Livonia	United States	English
 EXPLAIN
 SELECT Name FROM City
 WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND
@@ -2852,7 +1532,8 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	CountryLanguage	ALL	PRIMARY,Percentage	NULL	NULL	NULL	984	Using where
 1	SIMPLE	Country	eq_ref	PRIMARY	PRIMARY	3	world.CountryLanguage.Country	1	Using where; Using join buffer (flat, BKAH join)
@@ -2862,148 +1543,37 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 Name	Name	Language
-Leiden	Netherlands	Dutch
 La Matanza	Argentina	Spanish
 Lomas de Zamora	Argentina	Spanish
-La Plata	Argentina	Spanish
-Lan??s	Argentina	Spanish
-Las Heras	Argentina	Spanish
-La Rioja	Argentina	Spanish
-Li??ge	Belgium	Dutch
-La Paz	Bolivia	Spanish
-Londrina	Brazil	Portuguese
-Limeira	Brazil	Portuguese
-Lages	Brazil	Portuguese
-Luzi??nia	Brazil	Portuguese
 Lauro de Freitas	Brazil	Portuguese
-Linhares	Brazil	Portuguese
-London	United Kingdom	English
-Liverpool	United Kingdom	English
-Leeds	United Kingdom	English
-Leicester	United Kingdom	English
-Luton	United Kingdom	English
 Los Angeles	Chile	Spanish
-La Serena	Chile	Spanish
-La Romana	Dominican Republic	Spanish
-Loja	Ecuador	Spanish
-Luxor	Egypt	Arabic
 Las Palmas de Gran Canaria	Spain	Spanish
 L??Hospitalet de Llobregat	Spain	Spanish
-Legan??s	Spain	Spanish
-Le??n	Spain	Spanish
-Logro??o	Spain	Spanish
 Lleida (L??rida)	Spain	Spanish
-Le-Cap-Ha??tien	Haiti	Haiti Creole
-La Ceiba	Honduras	Spanish
-Livorno	Italy	Italian
-Latina	Italy	Italian
-Lecce	Italy	Italian
-La Spezia	Italy	Italian
-Linz	Austria	German
-London	Canada	English
-Laval	Canada	English
-Longueuil	Canada	English
-Lanzhou	China	Chinese
-Luoyang	China	Chinese
-Liuzhou	China	Chinese
-Liaoyang	China	Chinese
 Liupanshui	China	Chinese
-Liaoyuan	China	Chinese
 Lianyungang	China	Chinese
-Leshan	China	Chinese
-Linyi	China	Chinese
-Luzhou	China	Chinese
-Laiwu	China	Chinese
-Liaocheng	China	Chinese
-Laizhou	China	Chinese
-Linfen	China	Chinese
 Liangcheng	China	Chinese
-Longkou	China	Chinese
-Langfang	China	Chinese
-Liu??an	China	Chinese
-Longjing	China	Chinese
 Lengshuijiang	China	Chinese
-Laiyang	China	Chinese
-Longyan	China	Chinese
-Linhe	China	Chinese
-Leiyang	China	Chinese
-Loudi	China	Chinese
-Luohe	China	Chinese
-Linqing	China	Chinese
-Laohekou	China	Chinese
-Linchuan	China	Chinese
-Lhasa	China	Chinese
-Lianyuan	China	Chinese
-Liyang	China	Chinese
-Liling	China	Chinese
-Linhai	China	Chinese
-Larisa	Greece	Greek
-La Habana	Cuba	Spanish
-Lilongwe	Malawi	Chichewa
-Le??n	Mexico	Spanish
-La Paz	Mexico	Spanish
-La Paz	Mexico	Spanish
 L??zaro C??rdenas	Mexico	Spanish
 Lagos de Moreno	Mexico	Spanish
-Lerdo	Mexico	Spanish
-Los Cabos	Mexico	Spanish
-Lerma	Mexico	Spanish
 Las Margaritas	Mexico	Spanish
 Lashio (Lasho)	Myanmar	Burmese
 Lalitapur	Nepal	Nepali
-Le??n	Nicaragua	Spanish
-Lambar??	Paraguay	Spanish
-Lima	Peru	Spanish
-Lisboa	Portugal	Portuguese
-L??dz	Poland	Polish
-Lublin	Poland	Polish
-Legnica	Poland	Polish
-Lyon	France	French
-Le Havre	France	French
-Lille	France	French
-Le Mans	France	French
-Limoges	France	French
-Link??ping	Sweden	Swedish
-Lund	Sweden	Swedish
-Leipzig	Germany	German
-L??beck	Germany	German
 Ludwigshafen am Rhein	Germany	German
 Leverkusen	Germany	German
-L??nen	Germany	German
-Lahti	Finland	Finnish
-Lausanne	Switzerland	German
-Latakia	Syria	Arabic
 Luchou	Taiwan	Min
 Lungtan	Taiwan	Min
-Liberec	Czech Republic	Czech
-Lviv	Ukraine	Ukrainian
-Lugansk	Ukraine	Ukrainian
-Lutsk	Ukraine	Ukrainian
-Lysyt?ansk	Ukraine	Ukrainian
 Lower Hutt	New Zealand	English
-Lida	Belarus	Belorussian
 Los Teques	Venezuela	Spanish
-Lipetsk	Russian Federation	Russian
-Ljubertsy	Russian Federation	Russian
 Leninsk-Kuznetski	Russian Federation	Russian
-Long Xuyen	Vietnam	Vietnamese
 Los Angeles	United States	English
-Las Vegas	United States	English
 Long Beach	United States	English
 Lexington-Fayette	United States	English
 Louisville	United States	English
-Lincoln	United States	English
-Lubbock	United States	English
 Little Rock	United States	English
-Laredo	United States	English
-Lakewood	United States	English
-Lansing	United States	English
-Lancaster	United States	English
-Lafayette	United States	English
-Lowell	United States	English
-Livonia	United States	English
 EXPLAIN
 SELECT Name FROM City
 WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND
@@ -3159,7 +1729,8 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	CountryLanguage	ALL	PRIMARY,Percentage	NULL	NULL	NULL	984	Using where
 1	SIMPLE	Country	eq_ref	PRIMARY	PRIMARY	3	world.CountryLanguage.Country	1	Using where; Using join buffer (flat, BKAH join)
@@ -3169,148 +1740,37 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 Name	Name	Language
-Leiden	Netherlands	Dutch
 La Matanza	Argentina	Spanish
 Lomas de Zamora	Argentina	Spanish
-La Plata	Argentina	Spanish
-Lan??s	Argentina	Spanish
-Las Heras	Argentina	Spanish
-La Rioja	Argentina	Spanish
-Li??ge	Belgium	Dutch
-La Paz	Bolivia	Spanish
-Londrina	Brazil	Portuguese
-Limeira	Brazil	Portuguese
-Lages	Brazil	Portuguese
-Luzi??nia	Brazil	Portuguese
 Lauro de Freitas	Brazil	Portuguese
-Linhares	Brazil	Portuguese
-London	United Kingdom	English
-Liverpool	United Kingdom	English
-Leeds	United Kingdom	English
-Leicester	United Kingdom	English
-Luton	United Kingdom	English
 Los Angeles	Chile	Spanish
-La Serena	Chile	Spanish
-La Romana	Dominican Republic	Spanish
-Loja	Ecuador	Spanish
-Luxor	Egypt	Arabic
 Las Palmas de Gran Canaria	Spain	Spanish
 L??Hospitalet de Llobregat	Spain	Spanish
-Legan??s	Spain	Spanish
-Le??n	Spain	Spanish
-Logro??o	Spain	Spanish
 Lleida (L??rida)	Spain	Spanish
-Le-Cap-Ha??tien	Haiti	Haiti Creole
-La Ceiba	Honduras	Spanish
-Livorno	Italy	Italian
-Latina	Italy	Italian
-Lecce	Italy	Italian
-La Spezia	Italy	Italian
-Linz	Austria	German
-London	Canada	English
-Laval	Canada	English
-Longueuil	Canada	English
-Lanzhou	China	Chinese
-Luoyang	China	Chinese
-Liuzhou	China	Chinese
-Liaoyang	China	Chinese
 Liupanshui	China	Chinese
-Liaoyuan	China	Chinese
 Lianyungang	China	Chinese
-Leshan	China	Chinese
-Linyi	China	Chinese
-Luzhou	China	Chinese
-Laiwu	China	Chinese
-Liaocheng	China	Chinese
-Laizhou	China	Chinese
-Linfen	China	Chinese
 Liangcheng	China	Chinese
-Longkou	China	Chinese
-Langfang	China	Chinese
-Liu??an	China	Chinese
-Longjing	China	Chinese
 Lengshuijiang	China	Chinese
-Laiyang	China	Chinese
-Longyan	China	Chinese
-Linhe	China	Chinese
-Leiyang	China	Chinese
-Loudi	China	Chinese
-Luohe	China	Chinese
-Linqing	China	Chinese
-Laohekou	China	Chinese
-Linchuan	China	Chinese
-Lhasa	China	Chinese
-Lianyuan	China	Chinese
-Liyang	China	Chinese
-Liling	China	Chinese
-Linhai	China	Chinese
-Larisa	Greece	Greek
-La Habana	Cuba	Spanish
-Lilongwe	Malawi	Chichewa
-Le??n	Mexico	Spanish
-La Paz	Mexico	Spanish
-La Paz	Mexico	Spanish
 L??zaro C??rdenas	Mexico	Spanish
 Lagos de Moreno	Mexico	Spanish
-Lerdo	Mexico	Spanish
-Los Cabos	Mexico	Spanish
-Lerma	Mexico	Spanish
 Las Margaritas	Mexico	Spanish
 Lashio (Lasho)	Myanmar	Burmese
 Lalitapur	Nepal	Nepali
-Le??n	Nicaragua	Spanish
-Lambar??	Paraguay	Spanish
-Lima	Peru	Spanish
-Lisboa	Portugal	Portuguese
-L??dz	Poland	Polish
-Lublin	Poland	Polish
-Legnica	Poland	Polish
-Lyon	France	French
-Le Havre	France	French
-Lille	France	French
-Le Mans	France	French
-Limoges	France	French
-Link??ping	Sweden	Swedish
-Lund	Sweden	Swedish
-Leipzig	Germany	German
-L??beck	Germany	German
 Ludwigshafen am Rhein	Germany	German
 Leverkusen	Germany	German
-L??nen	Germany	German
-Lahti	Finland	Finnish
-Lausanne	Switzerland	German
-Latakia	Syria	Arabic
 Luchou	Taiwan	Min
 Lungtan	Taiwan	Min
-Liberec	Czech Republic	Czech
-Lviv	Ukraine	Ukrainian
-Lugansk	Ukraine	Ukrainian
-Lutsk	Ukraine	Ukrainian
-Lysyt?ansk	Ukraine	Ukrainian
 Lower Hutt	New Zealand	English
-Lida	Belarus	Belorussian
 Los Teques	Venezuela	Spanish
-Lipetsk	Russian Federation	Russian
-Ljubertsy	Russian Federation	Russian
 Leninsk-Kuznetski	Russian Federation	Russian
-Long Xuyen	Vietnam	Vietnamese
 Los Angeles	United States	English
-Las Vegas	United States	English
 Long Beach	United States	English
 Lexington-Fayette	United States	English
 Louisville	United States	English
-Lincoln	United States	English
-Lubbock	United States	English
 Little Rock	United States	English
-Laredo	United States	English
-Lakewood	United States	English
-Lansing	United States	English
-Lancaster	United States	English
-Lafayette	United States	English
-Lowell	United States	English
-Livonia	United States	English
 EXPLAIN
 SELECT Name FROM City
 WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND
@@ -3470,7 +1930,8 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	CountryLanguage	ALL	PRIMARY,Percentage	NULL	NULL	NULL	984	Using where
 1	SIMPLE	Country	hash	PRIMARY	PRIMARY	3	world.CountryLanguage.Country	239	Using where; Using join buffer (flat, BNLH join)
@@ -3480,148 +1941,37 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 Name	Name	Language
-Leiden	Netherlands	Dutch
 La Matanza	Argentina	Spanish
 Lomas de Zamora	Argentina	Spanish
-La Plata	Argentina	Spanish
-Lan??s	Argentina	Spanish
-Las Heras	Argentina	Spanish
-La Rioja	Argentina	Spanish
-Li??ge	Belgium	Dutch
-La Paz	Bolivia	Spanish
-Londrina	Brazil	Portuguese
-Limeira	Brazil	Portuguese
-Lages	Brazil	Portuguese
-Luzi??nia	Brazil	Portuguese
 Lauro de Freitas	Brazil	Portuguese
-Linhares	Brazil	Portuguese
-London	United Kingdom	English
-Liverpool	United Kingdom	English
-Leeds	United Kingdom	English
-Leicester	United Kingdom	English
-Luton	United Kingdom	English
 Los Angeles	Chile	Spanish
-La Serena	Chile	Spanish
-La Romana	Dominican Republic	Spanish
-Loja	Ecuador	Spanish
-Luxor	Egypt	Arabic
 Las Palmas de Gran Canaria	Spain	Spanish
 L??Hospitalet de Llobregat	Spain	Spanish
-Legan??s	Spain	Spanish
-Le??n	Spain	Spanish
-Logro??o	Spain	Spanish
 Lleida (L??rida)	Spain	Spanish
-Le-Cap-Ha??tien	Haiti	Haiti Creole
-La Ceiba	Honduras	Spanish
-Livorno	Italy	Italian
-Latina	Italy	Italian
-Lecce	Italy	Italian
-La Spezia	Italy	Italian
-Linz	Austria	German
-London	Canada	English
-Laval	Canada	English
-Longueuil	Canada	English
-Lanzhou	China	Chinese
-Luoyang	China	Chinese
-Liuzhou	China	Chinese
-Liaoyang	China	Chinese
 Liupanshui	China	Chinese
-Liaoyuan	China	Chinese
 Lianyungang	China	Chinese
-Leshan	China	Chinese
-Linyi	China	Chinese
-Luzhou	China	Chinese
-Laiwu	China	Chinese
-Liaocheng	China	Chinese
-Laizhou	China	Chinese
-Linfen	China	Chinese
 Liangcheng	China	Chinese
-Longkou	China	Chinese
-Langfang	China	Chinese
-Liu??an	China	Chinese
-Longjing	China	Chinese
 Lengshuijiang	China	Chinese
-Laiyang	China	Chinese
-Longyan	China	Chinese
-Linhe	China	Chinese
-Leiyang	China	Chinese
-Loudi	China	Chinese
-Luohe	China	Chinese
-Linqing	China	Chinese
-Laohekou	China	Chinese
-Linchuan	China	Chinese
-Lhasa	China	Chinese
-Lianyuan	China	Chinese
-Liyang	China	Chinese
-Liling	China	Chinese
-Linhai	China	Chinese
-Larisa	Greece	Greek
-La Habana	Cuba	Spanish
-Lilongwe	Malawi	Chichewa
-Le??n	Mexico	Spanish
-La Paz	Mexico	Spanish
-La Paz	Mexico	Spanish
 L??zaro C??rdenas	Mexico	Spanish
 Lagos de Moreno	Mexico	Spanish
-Lerdo	Mexico	Spanish
-Los Cabos	Mexico	Spanish
-Lerma	Mexico	Spanish
 Las Margaritas	Mexico	Spanish
 Lashio (Lasho)	Myanmar	Burmese
 Lalitapur	Nepal	Nepali
-Le??n	Nicaragua	Spanish
-Lambar??	Paraguay	Spanish
-Lima	Peru	Spanish
-Lisboa	Portugal	Portuguese
-L??dz	Poland	Polish
-Lublin	Poland	Polish
-Legnica	Poland	Polish
-Lyon	France	French
-Le Havre	France	French
-Lille	France	French
-Le Mans	France	French
-Limoges	France	French
-Link??ping	Sweden	Swedish
-Lund	Sweden	Swedish
-Leipzig	Germany	German
-L??beck	Germany	German
 Ludwigshafen am Rhein	Germany	German
 Leverkusen	Germany	German
-L??nen	Germany	German
-Lahti	Finland	Finnish
-Lausanne	Switzerland	German
-Latakia	Syria	Arabic
 Luchou	Taiwan	Min
 Lungtan	Taiwan	Min
-Liberec	Czech Republic	Czech
-Lviv	Ukraine	Ukrainian
-Lugansk	Ukraine	Ukrainian
-Lutsk	Ukraine	Ukrainian
-Lysyt?ansk	Ukraine	Ukrainian
 Lower Hutt	New Zealand	English
-Lida	Belarus	Belorussian
 Los Teques	Venezuela	Spanish
-Lipetsk	Russian Federation	Russian
-Ljubertsy	Russian Federation	Russian
 Leninsk-Kuznetski	Russian Federation	Russian
-Long Xuyen	Vietnam	Vietnamese
 Los Angeles	United States	English
-Las Vegas	United States	English
 Long Beach	United States	English
 Lexington-Fayette	United States	English
 Louisville	United States	English
-Lincoln	United States	English
-Lubbock	United States	English
 Little Rock	United States	English
-Laredo	United States	English
-Lakewood	United States	English
-Lansing	United States	English
-Lancaster	United States	English
-Lafayette	United States	English
-Lowell	United States	English
-Livonia	United States	English
 EXPLAIN
 SELECT Name FROM City
 WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND
@@ -3684,7 +2034,8 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	CountryLanguage	ALL	PRIMARY,Percentage	NULL	NULL	NULL	984	Using where
 1	SIMPLE	Country	hash	PRIMARY	PRIMARY	3	world.CountryLanguage.Country	239	Using where; Using join buffer (flat, BNLH join)
@@ -3694,148 +2045,37 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 Name	Name	Language
-Leiden	Netherlands	Dutch
 La Matanza	Argentina	Spanish
 Lomas de Zamora	Argentina	Spanish
-La Plata	Argentina	Spanish
-Lan??s	Argentina	Spanish
-Las Heras	Argentina	Spanish
-La Rioja	Argentina	Spanish
-Li??ge	Belgium	Dutch
-La Paz	Bolivia	Spanish
-Londrina	Brazil	Portuguese
-Limeira	Brazil	Portuguese
-Lages	Brazil	Portuguese
-Luzi??nia	Brazil	Portuguese
 Lauro de Freitas	Brazil	Portuguese
-Linhares	Brazil	Portuguese
-London	United Kingdom	English
-Liverpool	United Kingdom	English
-Leeds	United Kingdom	English
-Leicester	United Kingdom	English
-Luton	United Kingdom	English
 Los Angeles	Chile	Spanish
-La Serena	Chile	Spanish
-La Romana	Dominican Republic	Spanish
-Loja	Ecuador	Spanish
-Luxor	Egypt	Arabic
 Las Palmas de Gran Canaria	Spain	Spanish
 L??Hospitalet de Llobregat	Spain	Spanish
-Legan??s	Spain	Spanish
-Le??n	Spain	Spanish
-Logro??o	Spain	Spanish
 Lleida (L??rida)	Spain	Spanish
-Le-Cap-Ha??tien	Haiti	Haiti Creole
-La Ceiba	Honduras	Spanish
-Livorno	Italy	Italian
-Latina	Italy	Italian
-Lecce	Italy	Italian
-La Spezia	Italy	Italian
-Linz	Austria	German
-London	Canada	English
-Laval	Canada	English
-Longueuil	Canada	English
-Lanzhou	China	Chinese
-Luoyang	China	Chinese
-Liuzhou	China	Chinese
-Liaoyang	China	Chinese
 Liupanshui	China	Chinese
-Liaoyuan	China	Chinese
 Lianyungang	China	Chinese
-Leshan	China	Chinese
-Linyi	China	Chinese
-Luzhou	China	Chinese
-Laiwu	China	Chinese
-Liaocheng	China	Chinese
-Laizhou	China	Chinese
-Linfen	China	Chinese
 Liangcheng	China	Chinese
-Longkou	China	Chinese
-Langfang	China	Chinese
-Liu??an	China	Chinese
-Longjing	China	Chinese
 Lengshuijiang	China	Chinese
-Laiyang	China	Chinese
-Longyan	China	Chinese
-Linhe	China	Chinese
-Leiyang	China	Chinese
-Loudi	China	Chinese
-Luohe	China	Chinese
-Linqing	China	Chinese
-Laohekou	China	Chinese
-Linchuan	China	Chinese
-Lhasa	China	Chinese
-Lianyuan	China	Chinese
-Liyang	China	Chinese
-Liling	China	Chinese
-Linhai	China	Chinese
-Larisa	Greece	Greek
-La Habana	Cuba	Spanish
-Lilongwe	Malawi	Chichewa
-Le??n	Mexico	Spanish
-La Paz	Mexico	Spanish
-La Paz	Mexico	Spanish
 L??zaro C??rdenas	Mexico	Spanish
 Lagos de Moreno	Mexico	Spanish
-Lerdo	Mexico	Spanish
-Los Cabos	Mexico	Spanish
-Lerma	Mexico	Spanish
 Las Margaritas	Mexico	Spanish
 Lashio (Lasho)	Myanmar	Burmese
 Lalitapur	Nepal	Nepali
-Le??n	Nicaragua	Spanish
-Lambar??	Paraguay	Spanish
-Lima	Peru	Spanish
-Lisboa	Portugal	Portuguese
-L??dz	Poland	Polish
-Lublin	Poland	Polish
-Legnica	Poland	Polish
-Lyon	France	French
-Le Havre	France	French
-Lille	France	French
-Le Mans	France	French
-Limoges	France	French
-Link??ping	Sweden	Swedish
-Lund	Sweden	Swedish
-Leipzig	Germany	German
-L??beck	Germany	German
 Ludwigshafen am Rhein	Germany	German
 Leverkusen	Germany	German
-L??nen	Germany	German
-Lahti	Finland	Finnish
-Lausanne	Switzerland	German
-Latakia	Syria	Arabic
 Luchou	Taiwan	Min
 Lungtan	Taiwan	Min
-Liberec	Czech Republic	Czech
-Lviv	Ukraine	Ukrainian
-Lugansk	Ukraine	Ukrainian
-Lutsk	Ukraine	Ukrainian
-Lysyt?ansk	Ukraine	Ukrainian
 Lower Hutt	New Zealand	English
-Lida	Belarus	Belorussian
 Los Teques	Venezuela	Spanish
-Lipetsk	Russian Federation	Russian
-Ljubertsy	Russian Federation	Russian
 Leninsk-Kuznetski	Russian Federation	Russian
-Long Xuyen	Vietnam	Vietnamese
 Los Angeles	United States	English
-Las Vegas	United States	English
 Long Beach	United States	English
 Lexington-Fayette	United States	English
 Louisville	United States	English
-Lincoln	United States	English
-Lubbock	United States	English
 Little Rock	United States	English
-Laredo	United States	English
-Lakewood	United States	English
-Lansing	United States	English
-Lancaster	United States	English
-Lafayette	United States	English
-Lowell	United States	English
-Livonia	United States	English
 EXPLAIN
 SELECT Name FROM City
 WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND
@@ -3898,7 +2138,8 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	CountryLanguage	ALL	PRIMARY,Percentage	NULL	NULL	NULL	984	Using where
 1	SIMPLE	Country	eq_ref	PRIMARY	PRIMARY	3	world.CountryLanguage.Country	1	Using where; Using join buffer (flat, BKA join)
@@ -3908,148 +2149,37 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 Name	Name	Language
-Leiden	Netherlands	Dutch
 La Matanza	Argentina	Spanish
 Lomas de Zamora	Argentina	Spanish
-La Plata	Argentina	Spanish
-Lan??s	Argentina	Spanish
-Las Heras	Argentina	Spanish
-La Rioja	Argentina	Spanish
-Li??ge	Belgium	Dutch
-La Paz	Bolivia	Spanish
-Londrina	Brazil	Portuguese
-Limeira	Brazil	Portuguese
-Lages	Brazil	Portuguese
-Luzi??nia	Brazil	Portuguese
 Lauro de Freitas	Brazil	Portuguese
-Linhares	Brazil	Portuguese
-London	United Kingdom	English
-Liverpool	United Kingdom	English
-Leeds	United Kingdom	English
-Leicester	United Kingdom	English
-Luton	United Kingdom	English
 Los Angeles	Chile	Spanish
-La Serena	Chile	Spanish
-La Romana	Dominican Republic	Spanish
-Loja	Ecuador	Spanish
-Luxor	Egypt	Arabic
 Las Palmas de Gran Canaria	Spain	Spanish
 L??Hospitalet de Llobregat	Spain	Spanish
-Legan??s	Spain	Spanish
-Le??n	Spain	Spanish
-Logro??o	Spain	Spanish
 Lleida (L??rida)	Spain	Spanish
-Le-Cap-Ha??tien	Haiti	Haiti Creole
-La Ceiba	Honduras	Spanish
-Livorno	Italy	Italian
-Latina	Italy	Italian
-Lecce	Italy	Italian
-La Spezia	Italy	Italian
-Linz	Austria	German
-London	Canada	English
-Laval	Canada	English
-Longueuil	Canada	English
-Lanzhou	China	Chinese
-Luoyang	China	Chinese
-Liuzhou	China	Chinese
-Liaoyang	China	Chinese
 Liupanshui	China	Chinese
-Liaoyuan	China	Chinese
 Lianyungang	China	Chinese
-Leshan	China	Chinese
-Linyi	China	Chinese
-Luzhou	China	Chinese
-Laiwu	China	Chinese
-Liaocheng	China	Chinese
-Laizhou	China	Chinese
-Linfen	China	Chinese
 Liangcheng	China	Chinese
-Longkou	China	Chinese
-Langfang	China	Chinese
-Liu??an	China	Chinese
-Longjing	China	Chinese
 Lengshuijiang	China	Chinese
-Laiyang	China	Chinese
-Longyan	China	Chinese
-Linhe	China	Chinese
-Leiyang	China	Chinese
-Loudi	China	Chinese
-Luohe	China	Chinese
-Linqing	China	Chinese
-Laohekou	China	Chinese
-Linchuan	China	Chinese
-Lhasa	China	Chinese
-Lianyuan	China	Chinese
-Liyang	China	Chinese
-Liling	China	Chinese
-Linhai	China	Chinese
-Larisa	Greece	Greek
-La Habana	Cuba	Spanish
-Lilongwe	Malawi	Chichewa
-Le??n	Mexico	Spanish
-La Paz	Mexico	Spanish
-La Paz	Mexico	Spanish
 L??zaro C??rdenas	Mexico	Spanish
 Lagos de Moreno	Mexico	Spanish
-Lerdo	Mexico	Spanish
-Los Cabos	Mexico	Spanish
-Lerma	Mexico	Spanish
 Las Margaritas	Mexico	Spanish
 Lashio (Lasho)	Myanmar	Burmese
 Lalitapur	Nepal	Nepali
-Le??n	Nicaragua	Spanish
-Lambar??	Paraguay	Spanish
-Lima	Peru	Spanish
-Lisboa	Portugal	Portuguese
-L??dz	Poland	Polish
-Lublin	Poland	Polish
-Legnica	Poland	Polish
-Lyon	France	French
-Le Havre	France	French
-Lille	France	French
-Le Mans	France	French
-Limoges	France	French
-Link??ping	Sweden	Swedish
-Lund	Sweden	Swedish
-Leipzig	Germany	German
-L??beck	Germany	German
 Ludwigshafen am Rhein	Germany	German
 Leverkusen	Germany	German
-L??nen	Germany	German
-Lahti	Finland	Finnish
-Lausanne	Switzerland	German
-Latakia	Syria	Arabic
 Luchou	Taiwan	Min
 Lungtan	Taiwan	Min
-Liberec	Czech Republic	Czech
-Lviv	Ukraine	Ukrainian
-Lugansk	Ukraine	Ukrainian
-Lutsk	Ukraine	Ukrainian
-Lysyt?ansk	Ukraine	Ukrainian
 Lower Hutt	New Zealand	English
-Lida	Belarus	Belorussian
 Los Teques	Venezuela	Spanish
-Lipetsk	Russian Federation	Russian
-Ljubertsy	Russian Federation	Russian
 Leninsk-Kuznetski	Russian Federation	Russian
-Long Xuyen	Vietnam	Vietnamese
 Los Angeles	United States	English
-Las Vegas	United States	English
 Long Beach	United States	English
 Lexington-Fayette	United States	English
 Louisville	United States	English
-Lincoln	United States	English
-Lubbock	United States	English
 Little Rock	United States	English
-Laredo	United States	English
-Lakewood	United States	English
-Lansing	United States	English
-Lancaster	United States	English
-Lafayette	United States	English
-Lowell	United States	English
-Livonia	United States	English
 EXPLAIN
 SELECT Name FROM City
 WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND
@@ -4112,7 +2242,8 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	CountryLanguage	ALL	PRIMARY,Percentage	NULL	NULL	NULL	984	Using where
 1	SIMPLE	Country	eq_ref	PRIMARY	PRIMARY	3	world.CountryLanguage.Country	1	Using where; Using join buffer (flat, BKA join)
@@ -4122,148 +2253,37 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 Name	Name	Language
-Leiden	Netherlands	Dutch
 La Matanza	Argentina	Spanish
 Lomas de Zamora	Argentina	Spanish
-La Plata	Argentina	Spanish
-Lan??s	Argentina	Spanish
-Las Heras	Argentina	Spanish
-La Rioja	Argentina	Spanish
-Li??ge	Belgium	Dutch
-La Paz	Bolivia	Spanish
-Londrina	Brazil	Portuguese
-Limeira	Brazil	Portuguese
-Lages	Brazil	Portuguese
-Luzi??nia	Brazil	Portuguese
 Lauro de Freitas	Brazil	Portuguese
-Linhares	Brazil	Portuguese
-London	United Kingdom	English
-Liverpool	United Kingdom	English
-Leeds	United Kingdom	English
-Leicester	United Kingdom	English
-Luton	United Kingdom	English
 Los Angeles	Chile	Spanish
-La Serena	Chile	Spanish
-La Romana	Dominican Republic	Spanish
-Loja	Ecuador	Spanish
-Luxor	Egypt	Arabic
 Las Palmas de Gran Canaria	Spain	Spanish
 L??Hospitalet de Llobregat	Spain	Spanish
-Legan??s	Spain	Spanish
-Le??n	Spain	Spanish
-Logro??o	Spain	Spanish
 Lleida (L??rida)	Spain	Spanish
-Le-Cap-Ha??tien	Haiti	Haiti Creole
-La Ceiba	Honduras	Spanish
-Livorno	Italy	Italian
-Latina	Italy	Italian
-Lecce	Italy	Italian
-La Spezia	Italy	Italian
-Linz	Austria	German
-London	Canada	English
-Laval	Canada	English
-Longueuil	Canada	English
-Lanzhou	China	Chinese
-Luoyang	China	Chinese
-Liuzhou	China	Chinese
-Liaoyang	China	Chinese
 Liupanshui	China	Chinese
-Liaoyuan	China	Chinese
 Lianyungang	China	Chinese
-Leshan	China	Chinese
-Linyi	China	Chinese
-Luzhou	China	Chinese
-Laiwu	China	Chinese
-Liaocheng	China	Chinese
-Laizhou	China	Chinese
-Linfen	China	Chinese
 Liangcheng	China	Chinese
-Longkou	China	Chinese
-Langfang	China	Chinese
-Liu??an	China	Chinese
-Longjing	China	Chinese
 Lengshuijiang	China	Chinese
-Laiyang	China	Chinese
-Longyan	China	Chinese
-Linhe	China	Chinese
-Leiyang	China	Chinese
-Loudi	China	Chinese
-Luohe	China	Chinese
-Linqing	China	Chinese
-Laohekou	China	Chinese
-Linchuan	China	Chinese
-Lhasa	China	Chinese
-Lianyuan	China	Chinese
-Liyang	China	Chinese
-Liling	China	Chinese
-Linhai	China	Chinese
-Larisa	Greece	Greek
-La Habana	Cuba	Spanish
-Lilongwe	Malawi	Chichewa
-Le??n	Mexico	Spanish
-La Paz	Mexico	Spanish
-La Paz	Mexico	Spanish
 L??zaro C??rdenas	Mexico	Spanish
 Lagos de Moreno	Mexico	Spanish
-Lerdo	Mexico	Spanish
-Los Cabos	Mexico	Spanish
-Lerma	Mexico	Spanish
 Las Margaritas	Mexico	Spanish
 Lashio (Lasho)	Myanmar	Burmese
 Lalitapur	Nepal	Nepali
-Le??n	Nicaragua	Spanish
-Lambar??	Paraguay	Spanish
-Lima	Peru	Spanish
-Lisboa	Portugal	Portuguese
-L??dz	Poland	Polish
-Lublin	Poland	Polish
-Legnica	Poland	Polish
-Lyon	France	French
-Le Havre	France	French
-Lille	France	French
-Le Mans	France	French
-Limoges	France	French
-Link??ping	Sweden	Swedish
-Lund	Sweden	Swedish
-Leipzig	Germany	German
-L??beck	Germany	German
 Ludwigshafen am Rhein	Germany	German
 Leverkusen	Germany	German
-L??nen	Germany	German
-Lahti	Finland	Finnish
-Lausanne	Switzerland	German
-Latakia	Syria	Arabic
 Luchou	Taiwan	Min
 Lungtan	Taiwan	Min
-Liberec	Czech Republic	Czech
-Lviv	Ukraine	Ukrainian
-Lugansk	Ukraine	Ukrainian
-Lutsk	Ukraine	Ukrainian
-Lysyt?ansk	Ukraine	Ukrainian
 Lower Hutt	New Zealand	English
-Lida	Belarus	Belorussian
 Los Teques	Venezuela	Spanish
-Lipetsk	Russian Federation	Russian
-Ljubertsy	Russian Federation	Russian
 Leninsk-Kuznetski	Russian Federation	Russian
-Long Xuyen	Vietnam	Vietnamese
 Los Angeles	United States	English
-Las Vegas	United States	English
 Long Beach	United States	English
 Lexington-Fayette	United States	English
 Louisville	United States	English
-Lincoln	United States	English
-Lubbock	United States	English
 Little Rock	United States	English
-Laredo	United States	English
-Lakewood	United States	English
-Lansing	United States	English
-Lancaster	United States	English
-Lafayette	United States	English
-Lowell	United States	English
-Livonia	United States	English
 EXPLAIN
 SELECT Name FROM City
 WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND
@@ -4326,7 +2346,8 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	CountryLanguage	ALL	PRIMARY,Percentage	NULL	NULL	NULL	984	Using where
 1	SIMPLE	Country	eq_ref	PRIMARY	PRIMARY	3	world.CountryLanguage.Country	1	Using where; Using join buffer (flat, BKAH join)
@@ -4336,148 +2357,37 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 Name	Name	Language
-Leiden	Netherlands	Dutch
 La Matanza	Argentina	Spanish
 Lomas de Zamora	Argentina	Spanish
-La Plata	Argentina	Spanish
-Lan??s	Argentina	Spanish
-Las Heras	Argentina	Spanish
-La Rioja	Argentina	Spanish
-Li??ge	Belgium	Dutch
-La Paz	Bolivia	Spanish
-Londrina	Brazil	Portuguese
-Limeira	Brazil	Portuguese
-Lages	Brazil	Portuguese
-Luzi??nia	Brazil	Portuguese
 Lauro de Freitas	Brazil	Portuguese
-Linhares	Brazil	Portuguese
-London	United Kingdom	English
-Liverpool	United Kingdom	English
-Leeds	United Kingdom	English
-Leicester	United Kingdom	English
-Luton	United Kingdom	English
 Los Angeles	Chile	Spanish
-La Serena	Chile	Spanish
-La Romana	Dominican Republic	Spanish
-Loja	Ecuador	Spanish
-Luxor	Egypt	Arabic
 Las Palmas de Gran Canaria	Spain	Spanish
 L??Hospitalet de Llobregat	Spain	Spanish
-Legan??s	Spain	Spanish
-Le??n	Spain	Spanish
-Logro??o	Spain	Spanish
 Lleida (L??rida)	Spain	Spanish
-Le-Cap-Ha??tien	Haiti	Haiti Creole
-La Ceiba	Honduras	Spanish
-Livorno	Italy	Italian
-Latina	Italy	Italian
-Lecce	Italy	Italian
-La Spezia	Italy	Italian
-Linz	Austria	German
-London	Canada	English
-Laval	Canada	English
-Longueuil	Canada	English
-Lanzhou	China	Chinese
-Luoyang	China	Chinese
-Liuzhou	China	Chinese
-Liaoyang	China	Chinese
 Liupanshui	China	Chinese
-Liaoyuan	China	Chinese
 Lianyungang	China	Chinese
-Leshan	China	Chinese
-Linyi	China	Chinese
-Luzhou	China	Chinese
-Laiwu	China	Chinese
-Liaocheng	China	Chinese
-Laizhou	China	Chinese
-Linfen	China	Chinese
 Liangcheng	China	Chinese
-Longkou	China	Chinese
-Langfang	China	Chinese
-Liu??an	China	Chinese
-Longjing	China	Chinese
 Lengshuijiang	China	Chinese
-Laiyang	China	Chinese
-Longyan	China	Chinese
-Linhe	China	Chinese
-Leiyang	China	Chinese
-Loudi	China	Chinese
-Luohe	China	Chinese
-Linqing	China	Chinese
-Laohekou	China	Chinese
-Linchuan	China	Chinese
-Lhasa	China	Chinese
-Lianyuan	China	Chinese
-Liyang	China	Chinese
-Liling	China	Chinese
-Linhai	China	Chinese
-Larisa	Greece	Greek
-La Habana	Cuba	Spanish
-Lilongwe	Malawi	Chichewa
-Le??n	Mexico	Spanish
-La Paz	Mexico	Spanish
-La Paz	Mexico	Spanish
 L??zaro C??rdenas	Mexico	Spanish
 Lagos de Moreno	Mexico	Spanish
-Lerdo	Mexico	Spanish
-Los Cabos	Mexico	Spanish
-Lerma	Mexico	Spanish
 Las Margaritas	Mexico	Spanish
 Lashio (Lasho)	Myanmar	Burmese
 Lalitapur	Nepal	Nepali
-Le??n	Nicaragua	Spanish
-Lambar??	Paraguay	Spanish
-Lima	Peru	Spanish
-Lisboa	Portugal	Portuguese
-L??dz	Poland	Polish
-Lublin	Poland	Polish
-Legnica	Poland	Polish
-Lyon	France	French
-Le Havre	France	French
-Lille	France	French
-Le Mans	France	French
-Limoges	France	French
-Link??ping	Sweden	Swedish
-Lund	Sweden	Swedish
-Leipzig	Germany	German
-L??beck	Germany	German
 Ludwigshafen am Rhein	Germany	German
 Leverkusen	Germany	German
-L??nen	Germany	German
-Lahti	Finland	Finnish
-Lausanne	Switzerland	German
-Latakia	Syria	Arabic
 Luchou	Taiwan	Min
 Lungtan	Taiwan	Min
-Liberec	Czech Republic	Czech
-Lviv	Ukraine	Ukrainian
-Lugansk	Ukraine	Ukrainian
-Lutsk	Ukraine	Ukrainian
-Lysyt?ansk	Ukraine	Ukrainian
 Lower Hutt	New Zealand	English
-Lida	Belarus	Belorussian
 Los Teques	Venezuela	Spanish
-Lipetsk	Russian Federation	Russian
-Ljubertsy	Russian Federation	Russian
 Leninsk-Kuznetski	Russian Federation	Russian
-Long Xuyen	Vietnam	Vietnamese
 Los Angeles	United States	English
-Las Vegas	United States	English
 Long Beach	United States	English
 Lexington-Fayette	United States	English
 Louisville	United States	English
-Lincoln	United States	English
-Lubbock	United States	English
 Little Rock	United States	English
-Laredo	United States	English
-Lakewood	United States	English
-Lansing	United States	English
-Lancaster	United States	English
-Lafayette	United States	English
-Lowell	United States	English
-Livonia	United States	English
 EXPLAIN
 SELECT Name FROM City
 WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND
@@ -4540,7 +2450,8 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	CountryLanguage	ALL	PRIMARY,Percentage	NULL	NULL	NULL	984	Using where
 1	SIMPLE	Country	eq_ref	PRIMARY	PRIMARY	3	world.CountryLanguage.Country	1	Using where; Using join buffer (flat, BKAH join)
@@ -4550,148 +2461,37 @@
 WHERE City.Country=Country.Code AND
 CountryLanguage.Country=Country.Code AND
 City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-CountryLanguage.Percentage > 50;
+CountryLanguage.Percentage > 50 AND
+LENGTH(Language) < LENGTH(City.Name) - 2;
 Name	Name	Language
-Leiden	Netherlands	Dutch
 La Matanza	Argentina	Spanish
 Lomas de Zamora	Argentina	Spanish
-La Plata	Argentina	Spanish
-Lan??s	Argentina	Spanish
-Las Heras	Argentina	Spanish
-La Rioja	Argentina	Spanish
-Li??ge	Belgium	Dutch
-La Paz	Bolivia	Spanish
-Londrina	Brazil	Portuguese
-Limeira	Brazil	Portuguese
-Lages	Brazil	Portuguese
-Luzi??nia	Brazil	Portuguese
 Lauro de Freitas	Brazil	Portuguese
-Linhares	Brazil	Portuguese
-London	United Kingdom	English
-Liverpool	United Kingdom	English
-Leeds	United Kingdom	English
-Leicester	United Kingdom	English
-Luton	United Kingdom	English
 Los Angeles	Chile	Spanish
-La Serena	Chile	Spanish
-La Romana	Dominican Republic	Spanish
-Loja	Ecuador	Spanish
-Luxor	Egypt	Arabic
 Las Palmas de Gran Canaria	Spain	Spanish
 L??Hospitalet de Llobregat	Spain	Spanish
-Legan??s	Spain	Spanish
-Le??n	Spain	Spanish
-Logro??o	Spain	Spanish
 Lleida (L??rida)	Spain	Spanish
-Le-Cap-Ha??tien	Haiti	Haiti Creole
-La Ceiba	Honduras	Spanish
-Livorno	Italy	Italian
-Latina	Italy	Italian
-Lecce	Italy	Italian
-La Spezia	Italy	Italian
-Linz	Austria	German
-London	Canada	English
-Laval	Canada	English
-Longueuil	Canada	English
-Lanzhou	China	Chinese
-Luoyang	China	Chinese
-Liuzhou	China	Chinese
-Liaoyang	China	Chinese
 Liupanshui	China	Chinese
-Liaoyuan	China	Chinese
 Lianyungang	China	Chinese
-Leshan	China	Chinese
-Linyi	China	Chinese
-Luzhou	China	Chinese
-Laiwu	China	Chinese
-Liaocheng	China	Chinese
-Laizhou	China	Chinese
-Linfen	China	Chinese
 Liangcheng	China	Chinese
-Longkou	China	Chinese
-Langfang	China	Chinese
-Liu??an	China	Chinese
-Longjing	China	Chinese
 Lengshuijiang	China	Chinese
-Laiyang	China	Chinese
-Longyan	China	Chinese
-Linhe	China	Chinese
-Leiyang	China	Chinese
-Loudi	China	Chinese
-Luohe	China	Chinese
-Linqing	China	Chinese
-Laohekou	China	Chinese
-Linchuan	China	Chinese
-Lhasa	China	Chinese
-Lianyuan	China	Chinese
-Liyang	China	Chinese
-Liling	China	Chinese
-Linhai	China	Chinese
-Larisa	Greece	Greek
-La Habana	Cuba	Spanish
-Lilongwe	Malawi	Chichewa
-Le??n	Mexico	Spanish
-La Paz	Mexico	Spanish
-La Paz	Mexico	Spanish
 L??zaro C??rdenas	Mexico	Spanish
 Lagos de Moreno	Mexico	Spanish
-Lerdo	Mexico	Spanish
-Los Cabos	Mexico	Spanish
-Lerma	Mexico	Spanish
 Las Margaritas	Mexico	Spanish
 Lashio (Lasho)	Myanmar	Burmese
 Lalitapur	Nepal	Nepali
-Le??n	Nicaragua	Spanish
-Lambar??	Paraguay	Spanish
-Lima	Peru	Spanish
-Lisboa	Portugal	Portuguese
-L??dz	Poland	Polish
-Lublin	Poland	Polish
-Legnica	Poland	Polish
-Lyon	France	French
-Le Havre	France	French
-Lille	France	French
-Le Mans	France	French
-Limoges	France	French
-Link??ping	Sweden	Swedish
-Lund	Sweden	Swedish
-Leipzig	Germany	German
-L??beck	Germany	German
 Ludwigshafen am Rhein	Germany	German
 Leverkusen	Germany	German
-L??nen	Germany	German
-Lahti	Finland	Finnish
-Lausanne	Switzerland	German
-Latakia	Syria	Arabic
 Luchou	Taiwan	Min
 Lungtan	Taiwan	Min
-Liberec	Czech Republic	Czech
-Lviv	Ukraine	Ukrainian
-Lugansk	Ukraine	Ukrainian
-Lutsk	Ukraine	Ukrainian
-Lysyt?ansk	Ukraine	Ukrainian
 Lower Hutt	New Zealand	English
-Lida	Belarus	Belorussian
 Los Teques	Venezuela	Spanish
-Lipetsk	Russian Federation	Russian
-Ljubertsy	Russian Federation	Russian
 Leninsk-Kuznetski	Russian Federation	Russian
-Long Xuyen	Vietnam	Vietnamese
 Los Angeles	United States	English
-Las Vegas	United States	English
 Long Beach	United States	English
 Lexington-Fayette	United States	English
 Louisville	United States	English
-Lincoln	United States	English
-Lubbock	United States	English
 Little Rock	United States	English
-Laredo	United States	English
-Lakewood	United States	English
-Lansing	United States	English
-Lancaster	United States	English
-Lafayette	United States	English
-Lowell	United States	English
-Livonia	United States	English
 EXPLAIN
 SELECT Name FROM City
 WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND

=== modified file 'mysql-test/t/join_cache.test'
--- a/mysql-test/t/join_cache.test	2011-01-22 06:48:28 +0000
+++ b/mysql-test/t/join_cache.test	2011-01-24 22:54:50 +0000
@@ -46,14 +46,16 @@
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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
   FROM City,Country,CountryLanguage
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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;
 show variables like 'join_cache_level';
@@ -73,14 +75,16 @@
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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
   FROM City,Country,CountryLanguage
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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;
 show variables like 'join_cache_level';
@@ -100,14 +104,18 @@
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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
   FROM City,Country,CountryLanguage
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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;
 show variables like 'join_cache_level';
@@ -127,14 +135,16 @@
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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
   FROM City,Country,CountryLanguage
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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;
 
@@ -158,14 +168,16 @@
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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
   FROM City,Country,CountryLanguage
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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;
 show variables like 'join_cache_level';
@@ -185,14 +197,16 @@
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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
   FROM City,Country,CountryLanguage
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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;
 show variables like 'join_cache_level';
@@ -212,14 +226,16 @@
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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
   FROM City,Country,CountryLanguage
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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;
 show variables like 'join_cache_level';
@@ -239,14 +255,16 @@
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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
   FROM City,Country,CountryLanguage
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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_buffer_size=default;
@@ -290,14 +308,16 @@
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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
   FROM City,Country,CountryLanguage
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code AND
         City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-        CountryLanguage.Percentage > 50;
+        CountryLanguage.Percentage > 50 AND
+        LENGTH(Language) < LENGTH(City.Name) - 2;
 
 EXPLAIN
 SELECT Name FROM City
@@ -340,14 +360,16 @@
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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
   FROM City,Country,CountryLanguage
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code AND
         City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-        CountryLanguage.Percentage > 50;
+        CountryLanguage.Percentage > 50 AND
+        LENGTH(Language) < LENGTH(City.Name) - 2;
 
 EXPLAIN
 SELECT Name FROM City
@@ -391,14 +413,16 @@
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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
   FROM City,Country,CountryLanguage
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code AND
         City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-        CountryLanguage.Percentage > 50;
+        CountryLanguage.Percentage > 50 AND
+        LENGTH(Language) < LENGTH(City.Name) - 2;
 
 EXPLAIN
 SELECT Name FROM City
@@ -440,14 +464,16 @@
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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
   FROM City,Country,CountryLanguage
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code AND
         City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-        CountryLanguage.Percentage > 50;
+        CountryLanguage.Percentage > 50 AND
+        LENGTH(Language) < LENGTH(City.Name) - 2;
 
 EXPLAIN
 SELECT Name FROM City
@@ -489,14 +515,16 @@
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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
   FROM City,Country,CountryLanguage
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code AND
         City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-        CountryLanguage.Percentage > 50;
+        CountryLanguage.Percentage > 50 AND
+        LENGTH(Language) < LENGTH(City.Name) - 2;
 
 EXPLAIN
 SELECT Name FROM City
@@ -538,14 +566,16 @@
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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
   FROM City,Country,CountryLanguage
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code AND
         City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-        CountryLanguage.Percentage > 50;
+        CountryLanguage.Percentage > 50 AND
+        LENGTH(Language) < LENGTH(City.Name) - 2;
 
 EXPLAIN
 SELECT Name FROM City
@@ -590,14 +620,16 @@
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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
   FROM City,Country,CountryLanguage
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code AND
         City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-        CountryLanguage.Percentage > 50;
+        CountryLanguage.Percentage > 50 AND
+        LENGTH(Language) < LENGTH(City.Name) - 2;
 
 EXPLAIN
 SELECT Name FROM City
@@ -626,14 +658,16 @@
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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
   FROM City,Country,CountryLanguage
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code AND
         City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-        CountryLanguage.Percentage > 50;
+        CountryLanguage.Percentage > 50 AND
+        LENGTH(Language) < LENGTH(City.Name) - 2;
 
 EXPLAIN
 SELECT Name FROM City
@@ -662,14 +696,16 @@
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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
   FROM City,Country,CountryLanguage
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code AND
         City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-        CountryLanguage.Percentage > 50;
+        CountryLanguage.Percentage > 50 AND
+        LENGTH(Language) < LENGTH(City.Name) - 2;
 
 EXPLAIN
 SELECT Name FROM City
@@ -698,14 +734,16 @@
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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
   FROM City,Country,CountryLanguage
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code AND
         City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-        CountryLanguage.Percentage > 50;
+        CountryLanguage.Percentage > 50 AND
+        LENGTH(Language) < LENGTH(City.Name) - 2;
 
 EXPLAIN
 SELECT Name FROM City
@@ -734,14 +772,16 @@
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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
   FROM City,Country,CountryLanguage
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code AND
         City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-        CountryLanguage.Percentage > 50;
+        CountryLanguage.Percentage > 50 AND
+        LENGTH(Language) < LENGTH(City.Name) - 2;
 
 EXPLAIN
 SELECT Name FROM City
@@ -770,14 +810,16 @@
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code 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
   FROM City,Country,CountryLanguage
   WHERE City.Country=Country.Code AND
         CountryLanguage.Country=Country.Code AND
         City.Name LIKE 'L%' AND Country.Population > 3000000 AND
-        CountryLanguage.Percentage > 50;
+        CountryLanguage.Percentage > 50 AND
+        LENGTH(Language) < LENGTH(City.Name) - 2;
 
 EXPLAIN
 SELECT Name FROM City

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2011-01-23 18:39:53 +0000
+++ b/sql/sql_select.cc	2011-01-24 22:54:50 +0000
@@ -6445,6 +6445,7 @@
   } while (keyuse->table == table && keyuse->is_for_hash_join());
   if (!key_parts)
     DBUG_RETURN(TRUE);
+  /* This memory is allocated only once for the joined table join_tab */
   if (!(keyinfo= (KEY *) thd->alloc(sizeof(KEY))) ||
       !(key_part_info = (KEY_PART_INFO *) thd->alloc(sizeof(KEY_PART_INFO)*
                                                      key_parts)))
@@ -6525,19 +6526,15 @@
     {
       if (!(~used_tables & keyuse->used_tables))
       {
-	if (is_hash_join_key_no(key) && 
-	    (keyparts == 0 || keyuse->keypart != (keyuse-1)->keypart))
-	{ 
-	  length+= keyinfo->key_part[keyparts].store_length;
-	  keyparts++;
-	}
-	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++;
-	}
+        if ((is_hash_join_key_no(key) && 
+            (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;
+           keyparts++;
+           found_part_ref_or_null|= keyuse->optimize & ~KEY_OPTIMIZE_EQ;
+        }
       }
       keyuse++;
     } while (keyuse->table == table && keyuse->key == key);



More information about the commits mailing list