mysql> select version(); +----------------------------------+ | version() | +----------------------------------+ | 5.1.47-ndb-7.1.8-cluster-gpl-log | +----------------------------------+ 1 row in set (0.01 sec) mysql> set group_concat_max_len=1024*1024; Query OK, 0 rows affected (0.00 sec) mysql> create table t (a int unsigned not null primary key auto_increment, b varchar(188) character set latin1) engine ndb; Query OK, 0 rows affected (0.66 sec) mysql> insert into t values(NULL, 'this is a test'); Query OK, 1 row affected (0.01 sec) mysql> insert into t select NULL, b from t; # repeat 16 times Query OK, 1 row affected (0.00 sec) Records: 1 Duplicates: 0 Warnings: 0 mysql> insert into t select NULL, b from t; # repeat 16 times Query OK, 2 rows affected (0.00 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> insert into t select NULL, b from t; # repeat 16 times Query OK, 4 rows affected (0.00 sec) Records: 4 Duplicates: 0 Warnings: 0 mysql> insert into t select NULL, b from t; # repeat 16 times Query OK, 8 rows affected (0.00 sec) Records: 8 Duplicates: 0 Warnings: 0 mysql> insert into t select NULL, b from t; # repeat 16 times Query OK, 16 rows affected (0.00 sec) Records: 16 Duplicates: 0 Warnings: 0 mysql> insert into t select NULL, b from t; # repeat 16 times Query OK, 32 rows affected (0.00 sec) Records: 32 Duplicates: 0 Warnings: 0 mysql> insert into t select NULL, b from t; # repeat 16 times Query OK, 64 rows affected (0.00 sec) Records: 64 Duplicates: 0 Warnings: 0 mysql> insert into t select NULL, b from t; # repeat 16 times Query OK, 128 rows affected (0.00 sec) Records: 128 Duplicates: 0 Warnings: 0 mysql> insert into t select NULL, b from t; # repeat 16 times Query OK, 256 rows affected (0.00 sec) Records: 256 Duplicates: 0 Warnings: 0 mysql> insert into t select NULL, b from t; # repeat 16 times Query OK, 512 rows affected (0.01 sec) Records: 512 Duplicates: 0 Warnings: 0 mysql> insert into t select NULL, b from t; # repeat 16 times Query OK, 1024 rows affected (0.03 sec) Records: 1024 Duplicates: 0 Warnings: 0 mysql> insert into t select NULL, b from t; # repeat 16 times Query OK, 2048 rows affected (0.06 sec) Records: 2048 Duplicates: 0 Warnings: 0 mysql> insert into t select NULL, b from t; # repeat 16 times Query OK, 4096 rows affected (0.11 sec) Records: 4096 Duplicates: 0 Warnings: 0 mysql> insert into t select NULL, b from t; # repeat 16 times ^[[AQuery OK, 8192 rows affected (0.21 sec) Records: 8192 Duplicates: 0 Warnings: 0 mysql> insert into t select NULL, b from t; # repeat 16 times Query OK, 16384 rows affected (0.44 sec) Records: 16384 Duplicates: 0 Warnings: 0 mysql> insert into t select NULL, b from t; # repeat 16 times Query OK, 32768 rows affected (0.89 sec) Records: 32768 Duplicates: 0 Warnings: 0 mysql> analyze table t; +--------+---------+----------+----------+ | Table | Op | Msg_type | Msg_text | +--------+---------+----------+----------+ | test.t | analyze | status | OK | +--------+---------+----------+----------+ 1 row in set (0.00 sec) mysql> select @sql:=concat('delete from t where a in (', group_concat(a), ')') as s from (select a from t order by rand() limit 1000) as tt\G *************************** 1. row *************************** s: delete from t where a in (11296,54568,58065,6229,223,28713,41483,44932,38863,40596,47714,62372,31211,6110,53883,19890,15620,30081,55692,13490,1259,15495,22804,39866,33488,65532,63709,53678,60454,13554,41284,51555,2648,3687,3191,32170,45317,2050,21358,41578,40357,2190,41863,9820,1791,36440,54951,42609,49978,18313,47169,2152,27031,46194,23829,39693,51940,58608,33498,26419,6158,55466,5957,59153,1180,19412,29432,24634,24676,22087,29641,59334,42327,55355,3736,55935,17819,63532,44189,62257,45544,47378,33075,8922,24544,41887,60614,64083,20463,47556,37911,7556,44709,4422,54505,9778,59036,17432,10689,62053,15625,19435,16358,27239,39645,24339,46501,7195,17275,9680,60644,25093,61002,61696,4024,2681,22924,20173,61182,63609,53041,51935,52885,13604,51055,55657,22635,8593,62120,1981,48154,7485,27491,60047,4575,1808,43011,44701,64638,47915,2535,60033,40876,64474,45078,26499,61979,63711,13627,54992,43679,27422,19838,26092,47317,24992,36326,8141,4676,53326,38663,15172,27537,30152,28997,7279,60135,39725,60817,25996,39608,36819,41507,47893,41918,56672,18044,44321,12192,34314,19375,29972,36658,53550,9139,38210,9684,36989,54419,11781,58301,11505,57146,55891,27043,64262,53942,14761,29802,26795,53783,8788,5101,28022,32233,13557,25041,25017,36280,34777,30116,56414,54806,128,53448,61483,23550,7646,37143,17160,43539,32043,63074,8687,64342,60247,54038,57443,49306,8859,18158,65231,48964,40358,19653,7682,42410,12112,14869,46251,37845,47938,3990,3372,13680,46785,8054,40653,9081,6543,50277,63151,1711,42025,20954,11184,20680,41193,20075,36382,45350,38341,60478,28876,62195,4780,24130,10612,43581,40285,39100,35517,1716,43994,32349,46108,21459,45517,64043,5872,29055,16045,44381,48012,33950,438,28810,48420,53310,6651,35588,42850,25647,56488,5414,42853,46024,50740,3013,59776,36335,4541,64256,28568,45071,34336,5206,36999,43108,64663,4775,10479,41706,64484,13142,59010,48622,45586,55545,21093,40822,2568,5348,5547,5170,59267,43912,50453,41425,35973,56390,54677,38137,22113,29927,6385,36000,32741,63674,6180,41772,59833,63261,46333,30169,51189,15293,37214,6222,55350,41302,12121,26722,50450,44740,20149,39752,7831,6002,15707,889,57328,15652,1539,53402,16509,9271,29185,48193,38658,24833,49410,43135,25145,27349,30035,50449,64238,28712,50741,62884,23002,4851,19678,26005,6837,5979,56587,43516,53609,41983,37782,4285,39576,18555,24013,22270,216,35616,43295,20158,41212,48711,56119,9201,6026,43574,17698,50477,61869,25537,21178,43048,44354,11637,11844,36975,12311,28411,56921,18231,33940,14361,23837,11230,36791,15861,21634,24221,6429,63179,39044,49080,38338,55943,44042,57192,39284,7012,19683,58866,62231,53675,3871,12752,57844,20141,34574,7509,28669,35083,34023,9154,40106,5245,1965,31242,46839,13639,58862,32884,22036,58286,62601,28087,35626,9144,57012,26580,1433,32485,56111,60305,60146,18625,21858,39713,27498,2954,36710,35897,51899,35058,12682,45490,33155,55629,17475,20327,35763,23007,11079,17122,11134,30740,42455,48108,1208,13114,11348,12685,44939,32357,54245,13625,47868,26152,54671,39811,58699,63788,47738,21003,45090,35672,27818,38880,65449,50668,49846,39865,28072,52863,32952,37725,49096,61467,20833,46528,41456,17256,50719,42742,26256,8039,16007,322,2760,32176,47548,11052,19355,51217,19242,64974,55649,50919,8294,22381,14796,29521,3080,13922,44652,48805,29995,40117,61980,3643,7341,39073,22815,8408,11927,54668,43759,28960,18808,58749,13555,62586,6985,6231,14596,6406,11903,9842,9366,62326,7756,47699,31312,29492,52331,63789,610,5833,28714,154,35657,46464,39648,12144,10476,64381,25559,37754,11661,38412,18177,11622,7216,3910,15587,5949,36778,61125,18419,50886,17524,36574,26740,47343,53382,19990,48812,11207,58018,21086,29312,7565,4342,808,9688,6824,60122,53851,9160,22329,38770,34986,48619,59498,54200,29500,35323,6817,43641,63625,7189,42825,28280,46166,38788,53669,4239,54194,15751,38734,51788,29122,11067,29075,8594,41080,16454,32773,9107,56842,40147,46878,1848,23822,37593,3147,13428,46927,62500,63154,53776,42692,21396,884,1946,26700,30395,12794,29190,33178,43432,10266,62459,52886,60897,2081,29014,13381,49182,62197,3846,32748,46516,28067,50425,20357,60967,65498,50447,59306,23240,50717,1162,26569,19873,52362,17866,34232,12688,19086,19427,1130,10172,61759,55763,63412,51740,46407,32084,57948,60570,45744,53128,25607,272,4976,43344,2360,60604,36065,39628,25605,22539,36352,17142,28011,58933,2384,43845,39404,16312,6503,3901,14686,33340,12269,56179,35559,26999,2071,45808,6795,21775,3621,34775,47381,45783,3243,54938,18988,56648,5815,26395,27995,1704,39005,63613,19978,51507,59081,17425,42418,44182,6980,14911,30787,42321,6915,16697,30060,14815,18017,20457,44820,8256,54349,17922,62728,819,60801,47580,59207,40810,50069,33303,22222,23641,34175,40001,49359,43441,54300,30132,60236,17107,13099,37625,45592,40347,2224,1369,14997,59942,15344,46359,50841,55429,64290,15258,758,40574,17671,10461,22416,19848,1262,32067,30200,9766,43678,41428,35296,28993,61053,20888,38679,21799,37243,35221,19995,64009,46710,15194,37078,29934,51415,33297,11965,26383,2327,40211,4526,56686,23899,41872,7100,44633,30583,54986,4153,63872,10555,22640,673,940,51259,49020,16996,61681,37444,55719,18206,50158,32488,27018,19649,49281,36245,13406,42485,4625,19633,1612,6555,23353,51359,8889,21674,21953,56272,35735,10804,61386,58585,31373,1695,14225,26671,25648,35093,16808,1129,13629,48176,6500,22324,19968,48492,23967,25134,50711,7122,33039,1945,32860,32942,51718,61453,48166,40677,46318,19366,6450,62823,933,9117,28045,45639,38946,47294,58959,27694,49283,59388,55233,47480,2355,59691,45824,16211,2051,33988,30686,46537,13864,10760,57778,13122,59994,59175,59182,59046,52872,56033,50977,55215,12156,63997,62117,49888,44485,46599,1822,60996,64688,46388,54532,37781,51772,27361,43413,17714,12476,57598,36041,37752,33757,21315,45806,49456,59684,4326,55672,3216,41197,49391,32847,49127,57922,12115,5367,17188,19037,27713,38058,30323,51903,53832,1308,58732,3699) 1 row in set (0.26 sec) mysql> mysql> prepare stmt from @sql; Query OK, 0 rows affected (0.00 sec) Statement prepared mysql> mysql> begin; Query OK, 0 rows affected (0.00 sec) mysql> execute stmt; Query OK, 1000 rows affected (0.01 sec) mysql> execute stmt; Query OK, 4294967296 rows affected (0.01 sec) mysql> rollback; Query OK, 0 rows affected (0.00 sec) mysql> alter table t modify b varchar(187) character set latin1; Query OK, 65536 rows affected (3.79 sec) Records: 65536 Duplicates: 0 Warnings: 0 mysql> begin; Query OK, 0 rows affected (0.00 sec) mysql> execute stmt; Query OK, 1000 rows affected (0.00 sec) mysql> execute stmt; Query OK, 0 rows affected (0.01 sec) mysql> rollback; Query OK, 0 rows affected (0.00 sec) mysql> select @sql:=concat('delete from t where a in (', group_concat(a), ')') as s from (select a from t order by rand() limit 1010) as tt\G *************************** 1. row *************************** s: delete from t where a in (7595,14216,16136,16826,41670,23524,34138,30802,10309,10028,46984,11397,27378,52022,45581,7243,48217,56975,37566,57797,64565,57635,7630,51416,15620,49033,37669,33643,43624,17801,1258,37995,28376,12248,6952,5846,40998,63894,25994,52996,13793,35977,63260,11773,48423,872,4851,54735,9195,38623,21980,48883,16871,22140,33712,43725,61418,6292,19461,19490,9433,20545,13713,56977,5804,8788,64039,11586,11458,37552,1905,42595,22545,36327,34611,60877,48099,20741,35792,36514,29723,19709,19726,49569,1354,6370,52555,34004,16142,13062,17524,62312,35685,49572,22262,32108,2578,51702,58622,62352,17905,54026,46601,60557,61494,13386,28230,16192,32572,11160,32752,33732,9617,43362,8951,13715,52708,16337,33585,33890,46230,40973,54407,10864,24922,47389,6452,64689,55825,35592,36716,9624,21556,31321,62295,37985,10027,42621,2397,40502,10543,5352,58394,20504,56711,50893,31130,13780,32896,52638,6988,56234,30975,9757,41008,8673,32383,8940,60581,45862,21885,64144,29935,6906,41472,4792,17774,1053,4947,36482,23699,14749,20836,26118,25829,49633,32984,29826,29581,47150,13532,10446,18061,42258,29622,64226,31733,39407,55879,64136,12173,16429,56573,44222,63370,32900,8158,44657,28724,20346,57841,36800,13512,40472,52702,15878,15738,57894,434,26225,62920,17828,33167,62358,7035,30732,57578,55314,43128,25801,18292,13967,55242,17852,50688,54784,41602,15911,7938,33168,63542,3199,6351,3014,1701,32988,7355,24188,62482,17763,37406,30492,19971,47585,38078,7318,45613,29873,56220,46117,27465,13940,57425,1878,61549,45392,55766,27339,55278,57610,414,48336,21439,515,38597,7924,18344,58692,28189,61324,49663,32032,6398,13628,63402,51532,10682,38834,15341,12656,34035,41687,38435,5645,21825,59035,16909,22096,36175,38825,25591,53592,30408,33295,27045,36249,12919,50515,60573,8552,22913,60004,2726,65468,48048,20613,52149,14038,32182,54429,60290,27719,37309,18855,11615,18383,53249,56367,27943,36688,10380,49284,65036,21934,1217,16344,21370,55610,30987,53436,51540,5771,53509,52093,56461,50722,35581,17576,46530,62316,27261,44291,46839,49934,12877,14779,35135,44140,54120,60094,29885,2483,2744,15051,25866,19439,3643,57465,62976,8269,60606,64794,47211,55428,63381,38531,44000,40138,49765,13965,58031,28490,51936,53819,7015,33041,12569,49728,30412,49976,17081,42681,25690,49278,4677,17949,21817,25800,40811,60824,36312,27856,13840,27906,38653,13980,55240,41105,1045,18748,47503,15151,18600,43579,47795,39088,44531,25631,10169,48799,6215,56933,53333,60909,25290,65402,37553,930,15810,56967,26661,34159,62087,52481,12605,54886,5818,63776,4630,41460,2030,50123,9188,24823,55696,53252,57313,3379,22206,45869,38436,13281,19966,20285,19066,47348,32234,14514,37363,30335,35279,62194,34037,57995,63172,13472,14041,54227,49249,45296,20516,1431,36404,23452,23653,59596,1077,47643,10450,36994,37915,54617,32039,29136,41948,6839,13916,18145,30100,8787,23026,4934,62912,35019,31134,28675,16919,46292,8509,45917,1815,22393,43828,61939,26050,38895,58410,43917,62291,15417,20671,7289,19563,10076,956,16238,45097,40833,35731,22229,58383,53248,56304,12974,15674,52204,25836,43619,62172,64401,37351,59288,60907,39104,56063,22359,57297,54396,46799,61864,23628,65407,34271,37451,46818,31475,31252,53670,65105,51259,38476,9724,30863,52825,59233,62708,43752,5253,42208,5747,47015,1138,32101,65287,47480,46910,1541,7416,38620,6995,7024,50887,25385,3768,49477,35973,43513,43116,17419,425,25499,20042,55151,42777,46438,23753,9966,8757,51863,13558,11555,38466,35156,42808,22930,11968,37598,20964,11753,60576,27630,36184,18935,39001,24315,23440,5781,62642,52180,44477,56475,21236,31515,12048,12859,49827,51459,11181,19530,34205,22945,25877,7996,59054,49493,53705,17292,37025,43040,30427,28369,10295,53855,16161,55166,12139,48193,437,46592,10456,42458,12474,46457,12731,15995,62220,50367,3236,49721,24254,16311,38172,52735,9795,31838,43883,65127,3053,21762,35467,29887,18109,33028,2292,52657,46199,8535,10241,56481,28585,22280,34118,61252,41570,51239,12574,65339,52064,17605,51025,40705,17327,32200,20693,65381,11271,1838,51761,63350,12941,9013,39268,22406,37353,4256,32419,46415,36687,54865,64364,62131,21052,40723,19028,48843,62463,40286,26536,37384,64620,19697,28162,64347,55587,51834,3755,59236,57924,16786,62222,36231,10574,56487,27542,12565,11020,14122,51242,9011,6540,11258,21077,30097,15066,2835,25320,7760,54347,52311,20761,54210,65140,8812,64077,63281,40114,38306,60349,30049,63751,54663,33027,58287,14016,8308,63881,53988,40695,49573,5722,29926,653,31673,41152,14077,14632,10977,42873,48890,61849,59114,33455,15024,30601,8287,63823,45857,24719,29658,28163,35675,40761,8310,11938,1422,60023,31826,32209,26328,4986,1888,22606,30461,43207,14398,63475,57322,50837,47145,204,12290,56560,27784,64363,3941,43499,60425,5761,5728,58891,65334,10795,28621,23226,56755,29989,50327,28080,558,13045,26797,49288,34632,34961,42182,21963,54745,19131,62831,8680,11644,64521,64680,34753,15646,19281,16564,23974,45982,50870,57101,2388,61995,13487,16610,18892,39852,29875,22199,46577,42102,55855,31658,36188,65111,60074,31166,42259,41962,16083,61011,34834,30883,16541,53425,44773,14907,53587,49210,37968,41288,51531,2908,28746,40886,42320,43167,42342,50691,5754,32735,65058,1319,62181,18898,7562,50024,54908,30578,27287,14301,61122,8668,14777,46753,10075,32358,38010,47182,21233,33244,30362,8906,40098,62830,42517,20213,64738,35771,12213,4005,20771,24645,4475,31983,51987,2572,2500,21005,65215,5075,33801,16328,18265,58417,17175,37738,12418,59343,50161,32319,34556,30687,27141,15312,17448,48588,49357,27015,4801,39818,15790,22275,33988,45586,31849,46196,59340,63685,251,23356,43342,1846,51441,9643,36428,50411,64920,46275,40160,52251,44428,24691,1947,49679,63150,45928,21214,58646,12370,36204,7851,10443,29856,9243,33507,59595,57111,30637,1418,22128,8407,21710,61674,53794,49682,62249,23739,21746,10146,62277,4301,63917,5242,26209,33405,23952,15305,44532,56381,63188,17149,6187,23348,17221,54880,39044,44604,820,19468,58896,55147,40300,20312,8155,9486,12613,49890,30752,54558) 1 row in set (0.24 sec) mysql> prepare stmt from @sql; Query OK, 0 rows affected (0.00 sec) Statement prepared mysql> mysql> begin; Query OK, 0 rows affected (0.00 sec) mysql> execute stmt; Query OK, 1010 rows affected (0.01 sec) mysql> execute stmt; Query OK, 4294967296 rows affected (0.00 sec) mysql> rollback; Query OK, 0 rows affected (0.00 sec) mysql> alter table t modify b varchar(3000) character set latin1; Query OK, 65536 rows affected (4.74 sec) Records: 65536 Duplicates: 0 Warnings: 0 mysql> select @sql:=concat('delete from t where a in (', group_concat(a), ')') as s from (select a from t order by rand() limit 100) as tt\G *************************** 1. row *************************** s: delete from t where a in (39507,26237,33172,39391,3556,35790,54566,56016,19854,8721,50906,61890,53664,26813,8537,17998,41389,61504,58034,10860,24933,39877,25981,31904,61105,30149,14010,16672,3245,19048,46788,24036,13231,64045,2963,5514,44237,8785,8529,12768,63409,46055,62295,11820,49863,10205,34164,60096,40527,51716,27564,14634,15404,43597,47716,47526,1220,65033,17137,43808,63568,26284,27705,23293,44448,20868,47864,20952,12133,37181,5435,38596,5734,17018,43524,25604,54968,1339,55671,2843,307,36782,10048,30501,60933,923,57437,41804,26243,52960,27322,15653,16699,47230,61571,38574,38142,28682,11089,61553) 1 row in set (0.57 sec) mysql> mysql> prepare stmt from @sql; Query OK, 0 rows affected (0.00 sec) Statement prepared mysql> mysql> begin; Query OK, 0 rows affected (0.00 sec) mysql> execute stmt; Query OK, 100 rows affected (0.00 sec) mysql> execute stmt; Query OK, 4294967296 rows affected (0.00 sec) mysql> rollback; Query OK, 0 rows affected (0.00 sec) mysql> select @sql:=concat('explain select * from t where a in(', group_concat(a), ')') as s from (select a from t order by rand() limit 1000) as tt\G *************************** 1. row *************************** s: explain select * from t where a in(11169,18162,32746,34567,63465,31643,58855,30586,35406,19300,42898,17409,24490,25088,34220,23775,21696,59743,49402,59007,20171,38261,31107,22152,62350,6389,4809,29385,25565,51051,212,57112,46043,254,19747,57681,54442,49373,34755,41601,53821,50375,63592,38450,44490,56102,43032,8495,42220,52275,9383,23725,43279,21848,16662,48275,9025,9089,23053,59599,11752,1177,8713,47330,34977,13415,30940,65026,28321,5753,15684,52091,47614,50121,45969,27195,27183,14826,10690,23713,64475,58879,36313,23411,36981,30774,55891,50653,39206,62235,1742,2085,30638,35546,45171,2118,45347,62049,42659,48994,37370,56231,62125,39864,39786,74,64404,56493,53462,35393,4554,46430,33867,56396,18385,51237,56660,30415,18265,28395,23178,46162,23194,6275,56842,36007,40704,62863,41773,42804,9310,35538,32344,32405,50502,4659,21852,18834,43304,42850,65410,38967,30352,37914,9331,23048,36276,40317,61739,39752,47424,53710,16286,17164,31715,13322,15503,787,19885,52812,25041,21016,47802,7307,14390,37542,8562,51349,222,33877,9426,6931,22323,42729,55949,7620,45622,55067,36376,39814,17726,14492,49873,17255,16394,14507,25363,61402,16308,65053,51097,48126,62421,12757,2289,35184,59569,15313,34380,29650,63899,35992,73,41502,13609,56326,33774,62080,19853,15030,40187,36182,52489,48233,51693,20337,30178,23007,4846,6882,51897,42244,59380,22404,52105,20046,4357,17262,25963,60138,19939,60316,25405,59339,52463,15340,6722,24619,33897,32390,4703,44111,34724,42986,6417,56851,5840,20568,17548,39650,64200,40104,40755,48427,23123,4800,39337,30488,55955,136,32629,22998,7082,39419,18810,59361,56318,6709,2283,17810,54881,47354,58390,47171,29334,17017,4214,15235,23385,27,62388,48607,35555,18691,25751,26181,35115,38312,44015,38154,2254,55461,498,33635,26977,14012,780,8674,60159,40862,13670,27332,8314,6729,56932,12812,43288,50676,11740,17747,45612,27384,12520,49815,57139,36227,47622,58349,28381,49196,1007,20513,6847,25756,52968,26033,37229,42525,4771,53680,12622,23210,62617,28240,20908,52510,29901,27028,461,25176,5431,28796,33833,2221,58105,64466,29282,16862,63967,30887,46929,10951,53134,13710,11206,50017,6009,11627,52291,55848,59247,26593,60325,30678,60800,29937,11476,24249,6779,27104,59547,133,13399,19937,11163,8025,14641,38501,62438,65127,17609,1160,29812,9289,41630,53500,56187,57491,63219,30916,7979,47613,43605,2074,41498,34908,43838,17511,17011,34655,11777,7708,13512,2502,37103,29316,37157,6808,59000,42657,37577,6676,20528,4869,49526,17484,5687,63093,36674,19203,27419,28476,64115,48439,19644,61528,14926,4994,33667,45407,31206,52857,46478,34964,23550,3034,54600,21589,9218,16389,10993,2945,4653,49684,62695,35409,17617,48822,29116,58967,61846,12190,31159,4705,26398,46436,63535,11858,33039,10729,6040,32571,42766,60691,41161,7663,19242,16511,34353,60824,3799,45753,4109,9792,52189,15598,27831,15906,44982,44254,57019,60211,3360,48751,55548,32259,65111,61690,15357,54854,21822,33622,28109,51176,27906,22427,12855,17098,32517,33871,35234,11959,31891,43979,6024,15797,23177,21052,65257,45070,48982,9983,9133,40105,36603,54070,52575,64274,63624,42289,17568,21479,24546,29724,29588,65187,59557,38400,43424,5348,772,19098,60782,44566,1695,54602,3542,34186,23899,28275,29395,4105,33912,26541,54294,64406,20767,36077,12763,63663,38174,43532,22802,55118,56942,8749,29769,15015,20026,23099,31453,15636,4353,16032,1353,36766,20097,59601,15697,41096,1688,38997,53105,56460,53112,1811,27912,36183,17280,63423,52023,42628,19722,36667,31856,62596,50841,50395,27494,3793,36369,5640,21378,43880,27725,62680,13154,12284,3530,17838,39117,19526,11704,20597,30717,29670,49945,31923,3763,8715,37796,5083,4792,56136,37017,23012,60516,56170,32668,17757,62453,11957,6832,42624,32547,44524,9613,134,56327,7109,7222,49374,21386,62014,32477,4308,46689,8533,41057,50682,25906,62822,11551,7775,25896,53825,577,41033,15356,35520,27254,4664,30024,53223,44251,63278,19030,53910,11789,18309,24182,45133,5204,34294,56206,560,27290,15632,40160,55722,30784,14463,39674,59991,36389,32328,25833,21011,41039,17861,3279,41163,30565,23548,22729,743,22661,33911,56008,40878,62200,9928,53689,33685,29048,58017,27990,8152,26173,8457,64766,7467,56278,40262,13299,9120,36750,4451,43449,47464,15664,20877,51790,26222,21880,19223,24446,53897,37989,10705,7920,22883,11108,49090,12409,43993,55318,36695,11849,19980,21050,9676,14238,7253,7932,15738,37907,5502,30848,25493,47667,835,32830,40652,54628,46365,14832,35550,30935,18140,26999,9945,23110,29873,16348,28472,16792,63483,51876,4620,20807,61772,35981,10282,56828,46599,57908,32396,47319,26820,32661,60763,21645,63316,57432,61337,19626,25249,52754,53158,23677,49007,30227,58485,20021,8939,51440,63887,30004,23654,8337,52427,48153,64006,60694,18616,14069,18912,13637,26844,27281,32287,10920,46109,15994,47677,4431,6138,63696,33357,21553,3910,28182,50802,47855,34516,36445,10320,28755,32724,28800,35162,22789,24625,54383,12643,20503,25775,2245,11268,24749,51377,65437,45631,40232,62117,17933,14549,38506,9314,997,4119,11790,60557,61957,26859,6789,15269,58137,7146,34742,42356,41998,5339,2892,64028,11340,56424,43335,8418,42508,3528,41729,38735,36952,12079,10774,62851,55639,41688,18285,39875,40828,54122,21868,8553,15585,8378,61971,43814,15171,35761,20679,45656,3146,4567,210,5591,31432,42376,11216,8275,31845,41270,46195,50834,1540,26610,29406,40941,32960,50753,52353,36964,50674,63352,41022,51481,24230,16066,46997,7035,17403,21811,23689,38826,6337,31415,809,56468,19039,47799,55861,41622,63721,7962,17275,16952,3303,16442,10574,34688,55078,26778,41975,16285,54029,32075,26709,19999,43183,58499,63006,20940,53571,12765,30128,48048,23231,31060,49416,14629,56729,58302,11164,58410,31076,57650,7685,29746,48363,28455,14680,31739,13564,50421,13388,29858,43254,62686,62077,11384,42100,48059,1422,38078,43827,18504,36231,51025,10397,39473,64330,49462,20107,63168,14763,23072,50176,55255,9772,36710,26435,62794,45783,19986,58897,40705,36902,30162) 1 row in set (0.56 sec) mysql> mysql> prepare stmt from @sql; Query OK, 0 rows affected (0.00 sec) Statement prepared mysql> execute stmt; +----+-------------+-------+-------+---------------+---------+---------+------+------+-----------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+-------+---------------+---------+---------+------+------+-----------------------------------+ | 1 | SIMPLE | t | range | PRIMARY | PRIMARY | 4 | NULL | 1000 | Using where with pushed condition | +----+-------------+-------+-------+---------------+---------+---------+------+------+-----------------------------------+ 1 row in set (0.00 sec) mysql> set engine_condition_pushdown=OFF; Query OK, 0 rows affected (0.00 sec) mysql> select @sql:=concat('delete from t where a in (', group_concat(a), ')') as s from (select a from t order by rand() limit 100) as tt\G *************************** 1. row *************************** s: delete from t where a in (49548,32039,8685,50196,301,53500,31746,12683,53202,50652,22127,50227,22593,48258,10350,28795,3963,47002,52588,58752,20698,44896,30348,24655,47407,62391,33193,23774,56322,4406,52583,64048,23037,14029,63741,59411,56746,37669,55131,21968,51594,64312,35182,3486,47611,47000,25429,15335,5637,57181,27571,852,841,13533,30095,65447,12524,48754,9272,17916,58342,25763,29516,30492,30813,44533,5139,51076,42267,17303,53136,49397,5584,49033,63754,39804,33758,57284,43527,19923,38395,26207,50299,45313,16197,40336,34098,47190,41378,29449,52501,22302,11079,15970,65424,63440,27952,50821,64397,25146) 1 row in set (0.56 sec) mysql> mysql> prepare stmt from @sql; Query OK, 0 rows affected (0.00 sec) Statement prepared mysql> mysql> begin; Query OK, 0 rows affected (0.00 sec) mysql> execute stmt; Query OK, 100 rows affected (0.00 sec) mysql> execute stmt; Query OK, 4294967296 rows affected (0.01 sec) mysql> rollback; Query OK, 0 rows affected (0.00 sec) mysql> select @sql:=concat('explain select * from t where a in(', group_concat(a), ')') as s from (select a from t order by rand() limit 1000) as tt\G *************************** 1. row *************************** s: explain select * from t where a in(16759,11737,51643,6629,13364,10637,26396,42010,13363,23440,62376,55793,234,7124,41533,36732,119,63334,63458,13429,2279,61616,15047,61353,11583,1466,60538,49990,28880,50972,34238,34802,20379,29539,33891,16158,42246,35279,21075,13026,40671,30425,5814,47225,10582,40151,43410,39483,64313,3391,5098,47395,53317,47476,64432,57040,9992,17817,61180,8351,24788,37974,53249,35685,10809,49126,54613,20041,45594,13049,44110,29639,8706,50917,43708,6293,40844,36848,45023,36824,60815,48668,60028,5573,63784,38923,61747,41665,59437,38999,26564,27068,45158,52373,17551,31882,8933,38807,47268,58265,6712,41580,29075,37305,27758,1555,17491,49424,60289,29486,12645,18143,50222,61090,51913,4876,21498,35437,10163,60642,9807,21932,60600,57520,56815,32132,50155,17185,62206,38089,21229,6514,28355,8217,28461,50214,49760,47814,25951,48408,21197,13186,941,35573,12513,58586,7237,35006,43088,52494,50195,39688,3699,19735,564,25870,6544,50418,37007,25629,32730,63828,47282,20944,20914,22946,7225,18217,42674,49314,48043,16007,26150,22492,15108,47128,32492,36279,26558,13792,4080,43363,44527,53791,23070,6157,17861,53273,52741,7506,8530,41179,60854,33014,12128,40261,2623,6655,56769,3805,26510,21600,8353,25287,2469,11148,18885,48885,63045,19198,9614,5986,12406,11786,41922,546,55061,36602,8422,39208,26720,24669,29787,5156,6674,34869,15304,12700,18996,8046,11434,61026,50116,23413,56404,40913,20955,16664,11850,6176,62213,58096,53054,29167,49009,44384,5134,32567,15359,25617,21992,61125,28171,28609,59868,1253,9009,45214,27149,34340,55705,56172,58721,6312,7641,23160,36292,20646,33616,46442,52348,30261,26738,42575,40938,23703,19228,24556,56381,20150,2261,5873,21951,42618,12322,39197,31175,46225,59771,25628,59925,39669,35415,34374,37787,43457,34546,56277,57855,46522,40797,28199,60083,2480,14263,30067,758,7,53621,30161,30152,46543,51533,15680,8763,64570,36498,6458,48556,26239,4548,21276,34184,17431,43787,23527,16206,46,5813,47204,26864,51106,10574,23219,12954,8371,48511,55283,10128,45819,31036,44716,38097,25410,48175,64974,15956,59047,9135,62969,59600,10301,6797,63087,55001,28000,35762,41067,47408,19626,2592,56876,40305,59055,41673,23610,38209,33909,49815,21361,37860,45193,16221,42115,56125,13550,22103,20936,47200,2900,55596,23322,58362,9178,8614,30102,60218,27849,24305,2906,27951,35856,47383,52052,4632,56207,62788,19294,22147,34480,43541,54218,17233,27464,43289,51552,32019,65120,56254,23664,50804,4150,49811,44519,52510,8774,10024,52102,36253,41718,34852,43346,59086,28841,856,35091,39136,54186,59294,7345,38168,28731,51806,42809,28661,46858,8784,25160,41150,7167,36844,18837,47832,48131,40781,36678,60658,24876,6031,41216,33933,5387,27080,61364,58313,24130,12910,58418,14905,18441,15655,30134,8059,29940,31467,48608,33291,46022,34916,8620,15116,14445,49716,7338,49375,15767,53366,40716,53020,49366,54965,21000,21626,25528,45362,65030,12093,54034,35113,19604,2075,35322,63462,38263,58178,62350,507,27772,6420,47473,45330,39968,17919,2389,8952,13489,49152,16003,26456,15183,61394,39461,4603,46843,33449,39895,60613,27600,10866,24863,22401,27691,51311,41193,38083,44656,60132,34157,50021,43702,65460,57562,56441,43562,30054,44209,37712,27947,32993,3964,60429,49849,3754,4329,26109,52886,48928,13215,62887,53022,65479,10727,16725,14626,45227,47034,16002,29236,27547,38203,24349,56058,30180,10195,5747,43181,13377,12300,32502,28980,45324,23989,16983,24596,47640,15384,2131,29476,63783,12960,59300,45323,24231,3352,25809,57420,17391,16433,20031,4123,1085,51387,44815,60968,41155,19419,46244,30707,62897,53004,18630,34694,715,41037,32797,3571,62173,41206,41014,40570,25578,30385,14561,55703,35403,13187,6264,10772,19495,31264,40295,58826,16777,40624,6237,17989,31438,37289,59968,12313,45220,21015,23712,8718,32590,39227,20016,29001,835,15213,23408,11474,18300,9675,38978,9050,38765,8263,8724,8299,63596,18401,40082,9001,22337,20950,57131,53211,2933,27161,35632,59836,19155,46624,62234,59486,18429,26161,9280,21727,56798,44483,3015,59820,59161,26363,51459,41348,50727,56804,62869,41835,47658,2848,5842,21554,61150,16895,54452,42520,54604,38224,49430,7730,26244,1500,5823,37520,14379,29894,43954,45422,50556,32630,31640,9007,38357,57778,47615,20299,32359,4276,54216,28688,30421,35007,52550,46151,37829,33738,14721,2924,25382,18578,11667,47053,20627,64811,63477,32791,50151,45655,15881,489,59213,10639,61151,61671,64789,15190,22618,45267,37943,16651,25804,15863,28043,27776,17823,13923,53344,49439,54084,18357,52941,6081,37488,22371,30993,16995,64585,26916,44910,57276,44415,2290,35052,26364,41407,38639,53707,1495,2362,49169,41707,36615,28784,41675,21500,16514,57557,7865,29800,29509,23780,54787,43371,64836,30809,54397,43932,43803,38189,27425,24973,51157,52567,20296,25868,64083,53465,57034,32945,19346,23984,53328,53579,15752,38640,53520,37625,36399,46635,54879,29105,10997,12079,55835,1550,19299,45818,59331,45419,59500,32324,56517,2455,30584,17010,22497,44395,20348,50690,53857,33005,5937,2995,25228,23052,26035,35164,1844,21915,11437,37998,13713,45302,54586,3509,49111,18985,23113,46926,4450,43078,37603,48308,63072,31125,21402,21509,44513,55726,44911,63387,43988,10475,25424,24586,62658,33212,11217,51227,31743,37971,37993,59361,12571,55530,62770,52636,65517,47543,61249,6609,37582,25877,48677,24264,34158,56113,60672,62339,45843,10874,7938,28089,16630,17304,58505,45377,18865,30953,7632,1005,55684,39921,51035,13988,21925,52563,38290,14165,5748,29664,41677,15855,62480,16187,1781,20667,62314,63593,8430,51618,46489,43838,9765,57192,12720,44710,36425,6985,47925,44612,8298,1691,16827,5650,23460,51306,57091,40897,35835,510,10145,64987,6595,1744,62943,20256,48718,62267,1417,46152,31387,13585,2888,14733,48586,12672,14653,19982,5083,34248,45396,60001,35385,53541,61654,32055,15240,58388,680,62585,59664,25749,24199,34198,20234,25121,27988,42228,15113,41735,16398,61094,23731,23240,54219,21935,64773,18245,58830,24914,25102,58656,37831,10342,32207) 1 row in set (0.58 sec) mysql> mysql> prepare stmt from @sql; Query OK, 0 rows affected (0.00 sec) Statement prepared mysql> execute stmt; +----+-------------+-------+-------+---------------+---------+---------+------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+-------+---------------+---------+---------+------+------+-------------+ | 1 | SIMPLE | t | range | PRIMARY | PRIMARY | 4 | NULL | 1000 | Using where | +----+-------------+-------+-------+---------------+---------+---------+------+------+-------------+ 1 row in set (0.00 sec)