Zend certified PHP/Magento developer

Reindex catalog_product_attribute Deadlock found when trying to get lock

For some reason we fetch the following deadlock, when we run php bin/magento indexer:reindex catalog_product_attribute

Already tried reindex:reset and also performing a full reindex, but that does not solve the issue.

It looks like it has something to do with product status and visibility, because the attribute_id 97 and 99 are status and visibility. How can we solve/debug this?

[2023-12-13T12:32:18.726183+00:00] main.CRITICAL: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction, query was: INSERT INTO `catalog_product_index_eav_temp` SELECT `u`.* FROM ( (SELECT DISTINCT  `cpe`.`entity_id`, `dd`.`attribute_id`, `s`.`store_id`, COALESCE(ds.value, dd.value) AS `value`, `cpe`.`entity_id` AS `source_id` FROM `store` AS `s`
LEFT JOIN `catalog_product_entity_int` AS `dd` ON dd.store_id = 0
LEFT JOIN `catalog_product_entity_int` AS `ds` ON ds.store_id = s.store_id AND ds.attribute_id = dd.attribute_id AND ds.entity_id = dd.entity_id
LEFT JOIN `catalog_product_entity_int` AS `d2d` ON d2d.store_id = 0 AND d2d.entity_id = dd.entity_id AND d2d.attribute_id = 97
LEFT JOIN `catalog_product_entity_int` AS `d2s` ON d2s.store_id = s.store_id AND d2s.attribute_id = d2d.attribute_id AND d2s.entity_id = d2d.entity_id
LEFT JOIN `catalog_product_entity` AS `cpe` ON cpe.entity_id = dd.entity_id
LEFT JOIN `catalog_product_entity_int` AS `pis` ON pis.entity_id = cpe.entity_id AND pis.attribute_id = dd.attribute_id AND pis.store_id = s.store_id
INNER JOIN `catalog_product_entity_int` AS `tad_visibility` ON tad_visibility.entity_id = cpe.entity_id AND tad_visibility.attribute_id = 99 AND tad_visibility.store_id = 0
LEFT JOIN `catalog_product_entity_int` AS `tas_visibility` ON tas_visibility.entity_id = cpe.entity_id AND tas_visibility.attribute_id = 99 AND tas_visibility.store_id = s.store_id WHERE (s.store_id != 0) AND ((ds.value IS NOT NULL OR dd.value IS NOT NULL)) AND (COALESCE(d2s.value, d2d.value) = 1) AND (dd.attribute_id IN(6853,8079,8248,8270,99,147,148,170,212,213,214,215,232,287,309,310,387,554,555,592,594,636,637,648,672,699,765,806,950,1008,1009,1010,1011,1104,1114,1115,1122,1123,1189,1477,1522,1551,1686,1708,1722,1723,1724,1725,1726,1739,1743,1774,1792,1876,1877,1912,1913,1914,1915,1929,1930,1931,1933,1934,1935,1936,1937,1938,1945,1946,1958,2003,2006,2018,2085,2121,2133,2149,2150,2151,2152,2193,2194,2201,2214,2232,2270,2271,2376,2427,2439,2440,2446,2450,2457,2470,2496,2497,2498,2538,2539,2540,2541,2542,2595,2625,2639,2656,2657,2667,2673,2674,2702,2704,2706,2733,2752,2844,2845,2846,2847,2849,2855,2866,2884,2885,2894,2914,2919,2971,2976,3012,3030,3031,3040,3073,3074,3108,3153,3203,3204,3238,3239,3245,3246,3254,3352,3353,3354,3355,3356,3376,3482,3486,3508,3511,3512,3513,3521,3601,3646,3649,3659,3702,3767,3768,3823,3824,3825,3826,3827,3828,3829,3833,3834,3844,3868,3871,3895,3896,3897,3913,3958,4004,4019,4020,4076,4111,4132,4186,4187,4188,4189,4190,4191,4192,4193,4215,4237,4238,4239,4240,4278,4283,4284,4285,4289,4292,4297,4298,4303,4317,4318,4349,4368,4369,4393,4475,4479,4495,4514,4553,4614,4623,4652,4653,4659,4705,4712,4739,4783,4784,4786,4816,4825,4856,4857,4858,4859,4860,4861,4876,4963,5053,5081,5114,5151,5189,5195,5197,5222,5225,5256,5313,5314,5315,5316,5366,5370,5463,5464,5465,5489,5534,5535,5536,5609,5620,5631,5636,5643,5646,5651,5669,5685,5721,5722,5723,5724,5725,5726,5727,5728,5732,5748,5749,5754,5756,5777,5778,5823,5824,5869,5892,5907,5912,5916,5917,5928,5932,5938,5939,5948,6015,6027,6028,6029,6030,6069,6072,6074,6107,6110,6111,6112,6136,6151,6154,6155,6162,6215,6224,6225,6226,6227,6292,6321,6322,6349,6351,6359,6360,6361,6377,6380,6381,6399,6400,6401,6407,6424,6427,6436,6452,6455,6497,6604,6621,6659,6703,6704,6705,6706,6709,6710,6711,6719,6734,6737,6767,6773,6781,6783,6787,6806,6807,6808,6809,6831,6999,7001,7054,7093,7110,7112,7115,7116,7121,7131,7169,7170,7194,7217,7248,7264,7298,7328,7435,7436,7440,7449,7450,7546,7566,7578,7758,7769,7854,7895,8000,8017,8041,8068,8077,8165,8180,8183,8184,8279,8291,8294,8382,8383,8455,8458,8459,8465,8467,8468,8469,8470,8471,8472,8473,8476,8479,8480,8481,8482,8562,8581,8595,8674,8679,8822,8827,8828,8832,8842,8870,8878,9007)) AND (NOT(pis.value IS NULL AND pis.value_id IS NOT NULL)) AND (IFNULL(pis.value, COALESCE(ds.value, dd.value)) IS NOT NULL) AND (IF(IFNULL(tas_visibility.value_id, -1) > 0, tas_visibility.value, tad_visibility.value)>1) AND (cpe.entity_id IN(332911,332913,332915,332920,332927,332928,332935,332936,332942,332943,332944,333095,333098,333108,333109,333124,333125,333126,333136,333139,333145,333239,333268,333269,333272,333279,333299,333301,333303,333304,333305,333306,333307,333308,333309,333313,333367,333371,333372,333374,333376,333377,333381,333382,333383,333389,333390,333391,333399,333407,333412,333454,333503,333512,333513,333514,333517,333519,333520,333521,333526,333528,333529,333556,333561,333562,333563,333580,333582,333609,333614,333641,333642,333657,333659,333660,333661,333666,333667,333668,333669,333670,333676,333677,333678,333680,333681,333683,333684,333685,333687,333693,333694,333696,333719,333720,333733,333737,333752,333753,333754,333755,333756,333757,333758,333761,333878,333886,333894,333895,333897,333901,333902,333903,333904,333905,333906,333907,333908,333909,333912,333919,333920,333921,333922,333923,333924,333925,333926,333927,333935,333936,333943,333944,333945,333946,333952,333953,333978,333979,334015,334326,334327,334328,334329,334330,334331,334332,334333,334334,334336,334337,334339,334343,334344,334345,334347,334451,334452,334476,334477,334478,334479,334480,334481,334482,334483,334494,334512,334513,334519,334520,334521,334525,334526,334552,334553,334554,334555,334556,334557,334558,334563,334564,334565,334566,334567,334568,334569,334570,334571,334572,334573,334574,334575,334576,334577,334578,334579,334580,334582,334583,334584,334585,334586,334587,334593,334595,334596,334598,334599,334601,334602,334604,334605,334708,334754,334755,334756,334757,334758,334766,334767,334768,334769,334770,334771,334772,334773,334774,334791,334793,334806,334809,334816,334849,334851,334852,334858,334859,334860,334861,334862,334863,334864,334866,334867,334868,334869,334870,334871,334872,334873,334874,334875,334876,334877,334878,334879,334880,334881,334882,334883,334887,334888,334889,334890,334891,334892,334894,334895,334896,334897,334898,334899,334900,334901,334902,334903,334904,334905,334906,334907,334908,334909,334910,334911,334912,334913,334914,334915,334916,334920,334921,334923,334924,334925,334926,334927,334935,334940,335028,335074,335075,335076,335077,335091,335092,335100,335131,335132,335133,335134,335135,335136,335137,335138,335139,335140,335141,335142,335143,335144,335145,335146,335147,335148,335149,335150,335151,335152,335171,335172,335173,335174,335175,335198,335199,335200,335201,335202,335203,335204,335205,335206,335207,335208,335209,335210,335211,335214,335226,335481,335482,335483,335484,335485,335486,335487,335488,335492,335493,335494,335495,335499,335500,335512,335513,335514,335515,335532,335533,335535,335538,335620,335629,335630,335631,335632,335633,335634,335635,335636,335637,335639,335640,335641,335650,335651,335662,335664,335676,335697,335700,335701,335704,335705,335706,335707,335712,335713,335714,335750,335751,335760,335761,335762,335763,335764,335778,335779,335780,335800,335805,335806,335807,335808,335809,335810,335811,335812,335813,335814,335815,335816,335817,335818,335834,335929,335934,335935,335939,335945,336063,336074,336113,336114,336115,336116,336134,336135,336174,336175,336221,336222,336223,336224,336225,336226,336227,336228,336229,336230,336231,336232,336233,336234,336235,336236,336237,336238,336239,336241,336242,336243,336244,336245,336246,336247,336251,336252,336265,336266,336267,336268,336270,336271,336272,336282,336284,336285,336286,336287,336288,336300,336329,336330,336331,336335,336338,336339,336341,336342,336343,336344,336345,336346,336347,336348,336351,336352,336353,336354,336375,336376,336377,336378,336379,336380,336381,336382,336383,336384,336446,336697,336698,336715,336736,336758,336762,336763,336764,336765,336772,336776,336777,336778,336779,336780,336781,336783,336784,336789,336790,336791,336794,336816,336817,336818,336819,336823,336824,336825,336858,336861,337132,337163,337164,337165,337166,337167,337168,337171,337172,337173,337174,337175,337176,337177,337178,337179,337181,337182,337183,337185,337186,337187,337190,337191,337192,337193,337194,337195,337196,337197,337198,337199,337200,337202,337203,337204,337205,337206,337207,337210,337211,337212,337213,337216,337217,337218,337219,337220,337221,337222,337223,337224,337225,337227,337231,337235,337240,337241,337242,337243,337244,337245,337246,337247,337248,337249,337428,337429,337430,337433,337434,337437,337438,337441,337443,337444,337445,337459,337464,337465,337526,337527,337532,337550,337562,337563,337565,337566,337567,337568,337569,337570,337571,337572,337586,337587,337588,337589,337590,337596,337597,337605,337606,337607,337608,337609,337610,337619,337633,337634,337635,337636,337637,337638,337647,337650,337651,337652,337653,337654,337771,337772,337773,337774,340013,340014,340025,340027,340031,340035,340042,340046,340048,341886,341892,341909,341910,341911,341912,341914,341923,341924,341933,341999,342000,342001,342003,342004,342008,342009,342010,342044,342045,342046,342047,342048,342049,342050,342051,342231,342232,342233,342234,342235,342236,342237,342238,342239,342240,342241,342242,342243,342244,342245,342246,342247,342248,342249,342250,342251,342289,342290,342292,342571,342573,342574,343636,344396,344401,344615,344618,344619,344620,344621,344637,344643,344645,344651,344654,344655,344657,344662,346662,346663,346664,346665,346666,346679,346684,346685,346686,346689,346731,346735,346743,346776,346789,346790,346925,346926,346927,346929,346931,346932,346945,346949,346972,346973,346974,346975,346976,346977,346978,346979,346980,346981,346982,346983,346984,346985,346986,346987,346988,346999,347000,347001,347192,347204,347247,347251,347252,347254,347255,347256,347259,347272,347279,347281,347282,347283,347284,347285,347286,347287,347288,347289,347290,347291,347292,347293,347294,347295,347296,347297,347298,347299,347300,347301,347302,347308,347315,347316,347317,347318,347319,347320,347321,347322,347324,347325,347326,347327,347328,347334,347335,347336,347339,347340,347341,347342,347343,347344,347354,347355,347374,347375,347376,347377,347378,347379,347380,347381,347382,347383,347384,347385,347386,347388,347389,347390,347392,347393,347394,347395,347396,347397,347398,347399,347401,347402,347405,347406,347408,347409,347410,347413,347416,347436,347438,347439,347440,347441,347442,347443,347444,347445,347446,347447,347448,347449,347450,347451,347452,347453,347454,347455,347456,347457,347458,347459,347460,347461,347462,347463,347464,347465,347466,347467,347468,347469,347470,347471,347472,347473,347474,347475,347476,347477,347478,347479,347480,347481,347482,347483,347484,347485,347486,347487,347488,347489,347490,347491,347492,347493,347494,347495,347496,347497,347498,347499,347500,347501,347502,347503,347504,347505,347506,347507,347651,347657,347658,347665,347668,347780,347781,347799,347800,347808,347826,347828,347829,347832,347833,347841,347878,347879,347892,347893,347895,347896,347897,347917,347918,347994,347999,348046,348065,348140,348145,348147,348291,348386,348387,348388,348389,348391,348392,348393,348394,348395,348402,348409,348410,348411,348415)))UNION(SELECT `cpe`.`entity_id`, `wd`.`attribute_id`, `wd`.`store_id`, `wd`.`value`, `cpe`.`entity_id` FROM `catalog_product_entity_int` AS `wd`
LEFT JOIN `catalog_product_entity` AS `cpe` ON cpe.entity_id = wd.entity_id
LEFT JOIN `catalog_product_entity_int` AS `d2d` ON d2d.store_id = 0 AND d2d.entity_id = wd.entity_id AND d2d.attribute_id = 97
LEFT JOIN `catalog_product_entity_int` AS `d2s` ON d2s.store_id != 0 AND d2s.attribute_id = d2d.attribute_id AND d2s.entity_id = d2d.entity_id
INNER JOIN `catalog_product_entity_int` AS `tad_visibility` ON tad_visibility.entity_id = cpe.entity_id AND tad_visibility.attribute_id = 99 AND tad_visibility.store_id = 0
LEFT JOIN `catalog_product_entity_int` AS `tas_visibility` ON tas_visibility.entity_id = cpe.entity_id AND tas_visibility.attribute_id = 99 AND tas_visibility.store_id = wd.store_id WHERE (COALESCE(d2s.value, d2d.value) = 1) AND (wd.attribute_id IN(6853,8079,8248,8270,99,147,148,170,212,213,214,215,232,287,309,310,387,554,555,592,594,636,637,648,672,699,765,806,950,1008,1009,1010,1011,1104,1114,1115,1122,1123,1189,1477,1522,1551,1686,1708,1722,1723,1724,1725,1726,1739,1743,1774,1792,1876,1877,1912,1913,1914,1915,1929,1930,1931,1933,1934,1935,1936,1937,1938,1945,1946,1958,2003,2006,2018,2085,2121,2133,2149,2150,2151,2152,2193,2194,2201,2214,2232,2270,2271,2376,2427,2439,2440,2446,2450,2457,2470,2496,2497,2498,2538,2539,2540,2541,2542,2595,2625,2639,2656,2657,2667,2673,2674,2702,2704,2706,2733,2752,2844,2845,2846,2847,2849,2855,2866,2884,2885,2894,2914,2919,2971,2976,3012,3030,3031,3040,3073,3074,3108,3153,3203,3204,3238,3239,3245,3246,3254,3352,3353,3354,3355,3356,3376,3482,3486,3508,3511,3512,3513,3521,3601,3646,3649,3659,3702,3767,3768,3823,3824,3825,3826,3827,3828,3829,3833,3834,3844,3868,3871,3895,3896,3897,3913,3958,4004,4019,4020,4076,4111,4132,4186,4187,4188,4189,4190,4191,4192,4193,4215,4237,4238,4239,4240,4278,4283,4284,4285,4289,4292,4297,4298,4303,4317,4318,4349,4368,4369,4393,4475,4479,4495,4514,4553,4614,4623,4652,4653,4659,4705,4712,4739,4783,4784,4786,4816,4825,4856,4857,4858,4859,4860,4861,4876,4963,5053,5081,5114,5151,5189,5195,5197,5222,5225,5256,5313,5314,5315,5316,5366,5370,5463,5464,5465,5489,5534,5535,5536,5609,5620,5631,5636,5643,5646,5651,5669,5685,5721,5722,5723,5724,5725,5726,5727,5728,5732,5748,5749,5754,5756,5777,5778,5823,5824,5869,5892,5907,5912,5916,5917,5928,5932,5938,5939,5948,6015,6027,6028,6029,6030,6069,6072,6074,6107,6110,6111,6112,6136,6151,6154,6155,6162,6215,6224,6225,6226,6227,6292,6321,6322,6349,6351,6359,6360,6361,6377,6380,6381,6399,6400,6401,6407,6424,6427,6436,6452,6455,6497,6604,6621,6659,6703,6704,6705,6706,6709,6710,6711,6719,6734,6737,6767,6773,6781,6783,6787,6806,6807,6808,6809,6831,6999,7001,7054,7093,7110,7112,7115,7116,7121,7131,7169,7170,7194,7217,7248,7264,7298,7328,7435,7436,7440,7449,7450,7546,7566,7578,7758,7769,7854,7895,8000,8017,8041,8068,8077,8165,8180,8183,8184,8279,8291,8294,8382,8383,8455,8458,8459,8465,8467,8468,8469,8470,8471,8472,8473,8476,8479,8480,8481,8482,8562,8581,8595,8674,8679,8822,8827,8828,8832,8842,8870,8878,9007)) AND (wd.value IS NOT NULL) AND (wd.store_id != 0) AND (cpe.entity_id IN(332911,332913,332915,332920,332927,332928,332935,332936,332942,332943,332944,333095,333098,333108,333109,333124,333125,333126,333136,333139,333145,333239,333268,333269,333272,333279,333299,333301,333303,333304,333305,333306,333307,333308,333309,333313,333367,333371,333372,333374,333376,333377,333381,333382,333383,333389,333390,333391,333399,333407,333412,333454,333503,333512,333513,333514,333517,333519,333520,333521,333526,333528,333529,333556,333561,333562,333563,333580,333582,333609,333614,333641,333642,333657,333659,333660,333661,333666,333667,333668,333669,333670,333676,333677,333678,333680,333681,333683,333684,333685,333687,333693,333694,333696,333719,333720,333733,333737,333752,333753,333754,333755,333756,333757,333758,333761,333878,333886,333894,333895,333897,333901,333902,333903,333904,333905,333906,333907,333908,333909,333912,333919,333920,333921,333922,333923,333924,333925,333926,333927,333935,333936,333943,333944,333945,333946,333952,333953,333978,333979,334015,334326,334327,334328,334329,334330,334331,334332,334333,334334,334336,334337,334339,334343,334344,334345,334347,334451,334452,334476,334477,334478,334479,334480,334481,334482,334483,334494,334512,334513,334519,334520,334521,334525,334526,334552,334553,334554,334555,334556,334557,334558,334563,334564,334565,334566,334567,334568,334569,334570,334571,334572,334573,334574,334575,334576,334577,334578,334579,334580,334582,334583,334584,334585,334586,334587,334593,334595,334596,334598,334599,334601,334602,334604,334605,334708,334754,334755,334756,334757,334758,334766,334767,334768,334769,334770,334771,334772,334773,334774,334791,334793,334806,334809,334816,334849,334851,334852,334858,334859,334860,334861,334862,334863,334864,334866,334867,334868,334869,334870,334871,334872,334873,334874,334875,334876,334877,334878,334879,334880,334881,334882,334883,334887,334888,334889,334890,334891,334892,334894,334895,334896,334897,334898,334899,334900,334901,334902,334903,334904,334905,334906,334907,334908,334909,334910,334911,334912,334913,334914,334915,334916,334920,334921,334923,334924,334925,334926,334927,334935,334940,335028,335074,335075,335076,335077,335091,335092,335100,335131,335132,335133,335134,335135,335136,335137,335138,335139,335140,335141,335142,335143,335144,335145,335146,335147,335148,335149,335150,335151,335152,335171,335172,335173,335174,335175,335198,335199,335200,335201,335202,335203,335204,335205,335206,335207,335208,335209,335210,335211,335214,335226,335481,335482,335483,335484,335485,335486,335487,335488,335492,335493,335494,335495,335499,335500,335512,335513,335514,335515,335532,335533,335535,335538,335620,335629,335630,335631,335632,335633,335634,335635,335636,335637,335639,335640,335641,335650,335651,335662,335664,335676,335697,335700,335701,335704,335705,335706,335707,335712,335713,335714,335750,335751,335760,335761,335762,335763,335764,335778,335779,335780,335800,335805,335806,335807,335808,335809,335810,335811,335812,335813,335814,335815,335816,335817,335818,335834,335929,335934,335935,335939,335945,336063,336074,336113,336114,336115,336116,336134,336135,336174,336175,336221,336222,336223,336224,336225,336226,336227,336228,336229,336230,336231,336232,336233,336234,336235,336236,336237,336238,336239,336241,336242,336243,336244,336245,336246,336247,336251,336252,336265,336266,336267,336268,336270,336271,336272,336282,336284,336285,336286,336287,336288,336300,336329,336330,336331,336335,336338,336339,336341,336342,336343,336344,336345,336346,336347,336348,336351,336352,336353,336354,336375,336376,336377,336378,336379,336380,336381,336382,336383,336384,336446,336697,336698,336715,336736,336758,336762,336763,336764,336765,336772,336776,336777,336778,336779,336780,336781,336783,336784,336789,336790,336791,336794,336816,336817,336818,336819,336823,336824,336825,336858,336861,337132,337163,337164,337165,337166,337167,337168,337171,337172,337173,337174,337175,337176,337177,337178,337179,337181,337182,337183,337185,337186,337187,337190,337191,337192,337193,337194,337195,337196,337197,337198,337199,337200,337202,337203,337204,337205,337206,337207,337210,337211,337212,337213,337216,337217,337218,337219,337220,337221,337222,337223,337224,337225,337227,337231,337235,337240,337241,337242,337243,337244,337245,337246,337247,337248,337249,337428,337429,337430,337433,337434,337437,337438,337441,337443,337444,337445,337459,337464,337465,337526,337527,337532,337550,337562,337563,337565,337566,337567,337568,337569,337570,337571,337572,337586,337587,337588,337589,337590,337596,337597,337605,337606,337607,337608,337609,337610,337619,337633,337634,337635,337636,337637,337638,337647,337650,337651,337652,337653,337654,337771,337772,337773,337774,340013,340014,340025,340027,340031,340035,340042,340046,340048,341886,341892,341909,341910,341911,341912,341914,341923,341924,341933,341999,342000,342001,342003,342004,342008,342009,342010,342044,342045,342046,342047,342048,342049,342050,342051,342231,342232,342233,342234,342235,342236,342237,342238,342239,342240,342241,342242,342243,342244,342245,342246,342247,342248,342249,342250,342251,342289,342290,342292,342571,342573,342574,343636,344396,344401,344615,344618,344619,344620,344621,344637,344643,344645,344651,344654,344655,344657,344662,346662,346663,346664,346665,346666,346679,346684,346685,346686,346689,346731,346735,346743,346776,346789,346790,346925,346926,346927,346929,346931,346932,346945,346949,346972,346973,346974,346975,346976,346977,346978,346979,346980,346981,346982,346983,346984,346985,346986,346987,346988,346999,347000,347001,347192,347204,347247,347251,347252,347254,347255,347256,347259,347272,347279,347281,347282,347283,347284,347285,347286,347287,347288,347289,347290,347291,347292,347293,347294,347295,347296,347297,347298,347299,347300,347301,347302,347308,347315,347316,347317,347318,347319,347320,347321,347322,347324,347325,347326,347327,347328,347334,347335,347336,347339,347340,347341,347342,347343,347344,347354,347355,347374,347375,347376,347377,347378,347379,347380,347381,347382,347383,347384,347385,347386,347388,347389,347390,347392,347393,347394,347395,347396,347397,347398,347399,347401,347402,347405,347406,347408,347409,347410,347413,347416,347436,347438,347439,347440,347441,347442,347443,347444,347445,347446,347447,347448,347449,347450,347451,347452,347453,347454,347455,347456,347457,347458,347459,347460,347461,347462,347463,347464,347465,347466,347467,347468,347469,347470,347471,347472,347473,347474,347475,347476,347477,347478,347479,347480,347481,347482,347483,347484,347485,347486,347487,347488,347489,347490,347491,347492,347493,347494,347495,347496,347497,347498,347499,347500,347501,347502,347503,347504,347505,347506,347507,347651,347657,347658,347665,347668,347780,347781,347799,347800,347808,347826,347828,347829,347832,347833,347841,347878,347879,347892,347893,347895,347896,347897,347917,347918,347994,347999,348046,348065,348140,348145,348147,348291,348386,348387,348388,348389,348391,348392,348393,348394,348395,348402,348409,348410,348411,348415)) AND (IF(IFNULL(tas_visibility.value_id, -1) > 0, tas_visibility.value, tad_visibility.value)>1)) ) AS `u` [] []