# the statements: create database TestECP; use TestECP; CREATE TABLE `TestSmall` ( `Id` char(8) DEFAULT NULL, `PZN` char(7) DEFAULT NULL, `EVP` decimal(7,2) DEFAULT NULL, `HAP` decimal(7,2) DEFAULT NULL, `ArtikelBez` varchar(40) DEFAULT NULL, `ArtikelText` varchar(26) DEFAULT NULL, `Hersteller` char(5) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ; CREATE TABLE `TestBig` ( `Id` char(8) DEFAULT NULL, `PZN` char(7) DEFAULT NULL, `EVP` decimal(7,2) DEFAULT NULL, `HAP` decimal(7,2) DEFAULT NULL, `ArtikelBez` varchar(40) DEFAULT NULL, `ArtikelText` varchar(26) DEFAULT NULL, `Hersteller` char(5) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ; insert into TestSmall values( '1002100', '12', 3.95, 1.83, 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXX', '00020'), ( '1025266', '3717968', 0.00, 2.90, 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXX', '00020'), ( '1025267', '222', 0.00, 4.45, 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXX', '00020'), ( '1025268', '3717980', 0.00, 6.30, 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXX', '00020'), ( '1025269', '3717997', 0.00, 6.30, 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXX', '00020') ; insert into TestBig values ( '01000001', '111', 0.00, 18.91, 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXX', '36367'), ( '01000025', '999999', 82.95, 0.00, 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXX', '36367'), ( '01000045', '222', 0.00, 383.92, 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXX', '36367'), ( '01000072', '999999', 0.00, 18.32, 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXX', '36367'), ( '01000110', '999999', 0.00, 0.00, 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXX', '36367'), ( '01000114', '999999', 13.06, 12.54, 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXX', '36367'), ( '01000118', '204665', 25.43, 7.87, 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXX', '36367'), ( '01000120', '999999', 0.00, 0.00, 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXX', '36367'), ( '01000139', '999999', 11.80, 3.90, 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXX', '36367'), ( '01000141', '999999', 0.00, 0.00, 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXX', '36367') ; # to produce the effect described: set optimizer_switch='engine_condition_pushdown=on'; select SQL_NO_CACHE B.PZN, B.ArtikelText from TestSmall B where exists ( select 1 from TestBig A where A.Hersteller = '36367' and A.PZN = B.PZN) and B.Hersteller = '00020'; # the result in cond_push(): for TestSmall: OK for TestBig: OK start scanning TestSmall: OK 1st scanning TestBig: FIELD-ITEM [TestECP] [B] [PZN] name= 2nd scanning TestBig: FIELD-ITEM [TestECP] [B] [PZN] str_length=<2> str_value=<37> name= 3rd scanning TestBig: FIELD-ITEM [TestECP] [B] [PZN] str_length=<7> str_value=<222 > name= 4th scanning TestBig: FIELD-ITEM [TestECP] [B] [PZN] str_length=<3> str_value=<371> name= 5th scanning TestBig: FIELD-ITEM [TestECP] [B] [PZN] str_length=<7> str_value=<3717997> name= as you cann see from the INSERT-statement above it is: 1st: is <>, should have been <12> 2nd: is <2>, should have been <3717968> 3rd: is <222 >, should have been <222> 4th: ia <371>, should have been <3717980> 5th: is <3717997>, this is correct!