wordpress-seo icon indicating copy to clipboard operation
wordpress-seo copied to clipboard

WPSEO_Premium_Orphaned_Post_Filter->get_post_total slows down dashboard

Open ziodave opened this issue 8 years ago • 24 comments

  • [x] I've read and understood the contribution guidelines.
  • [x] I've searched for any related issues and avoided creating a duplicate issue.

Please give us a description of what happened.

WordPress dashboard is slow. By using the Query Monitor plugin I found that the WPSEO_Premium_Orphaned_Post_Filter->get_post_total() function is running a slow query:

SELECT COUNT(ID)
FROM wp_posts
WHERE ID IN ( ...thousands of post ids... );

The query may take up to one second to execute representing about 20% of the overall dashboard load time.

Please describe what you expected to happen and why.

I expect faster load times.

How can we reproduce this behavior?

  1. Create thousands of posts (I have about 35.000)
  2. Open the dashboard
  3. Use Query Monitor to see the time it takes.

Technical info

  • WordPress version: 4.8.4
  • Yoast SEO version: 5.7.1
  • Relevant plugins in case of a bug: -

ziodave avatar Jan 10 '18 09:01 ziodave

I've disabled the Text link counter, when doing so the same query is run by WPSEO_Premium_Orphaned_Post_Query::get_counts().

ziodave avatar Jan 10 '18 09:01 ziodave

Please inform the customer of conversation # 296181 when this conversation has been closed.

amboutwe avatar Jan 26 '18 20:01 amboutwe

Please inform the customer of conversation # 315931 when this conversation has been closed.

rmarcano avatar Feb 28 '18 00:02 rmarcano

The above user is getting the error below in the server's logs. He contacted WPEngine and they confirmed that the query was killed because it took too long. Their limit is 2 minutes and they are not flexible about that.

[Mon Feb 26 22:06:15.794235 2018] [:error] [pid 16545] [client 104.198.69.90:48634] KILLED QUERY (45402 characters long generated in /xxxxxx/wp-content/plugins/wordpress-seo-premium/premium/classes/premium-orphaned-post-query.php:35): SELECT COUNT( ID ) as total_orphaned, post_type\n\t\t\t\t\t\tFROM wp_posts\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tID IN ( 59,65,118,161,239,278,288,315,327,473,497,522,528,683,733,734,773,777,783,786,800,806,807,838,842,873,878,883,912,974,1057,1068,1070,1079,1088,1200,1374,1419,1422,1423,1425,1426,1500,1515,1519,1619,1625,1627,1718,1794,1804,1815,1816,1867,1874,2131,2135,2143,2256,2351,2410,2454,2464,2467,2468,2470,2471,2472,2473,2515,2516,2518,2519,2520,2522,2553,2766,2792,2841,2873,2944,2946,2948,2949,2954,2960,3054,3055,3058,3062,3063,3092,3117,3145,3146,3147,3181,3184,3218,3221,3259,3269,3278,3294,3295,3297,3459,3461,3496,3590,3651,3653,3667,3700,3703,3768,3853,3946,4050,4087,4257,4258,4260,4261,4278,4285,4398,4715,4748,5202,5394,5440,5504,5519,5527,5765,5780,5792,6106,6114,6123,6166,6275,6311,6316,6376,6386,6418,6463,6506,6535,6651,6948,6950,6964,6971,6978,6983,6984,6985,7042,7045,7091,7223,7384,7425,7474,7567,7570,7573,7574,7580,7585,7587,7589,7631,7635,7637,7643,7707,7715,7716,7717,7718,7742,7782,7792,7795,7919,7921,7930,7951,7952,7955,7975,8029,8038,8067,8105,8123,8142,8143,8144,8345,8366,8412,8424,8604,8605,8608,8623,8625,8626,8628,8661,8790,8801,8814,8850,8911,8982,8983,8984,8985,8986,9036,9191,9257,9320,9331,9354,9356,9406,9630,9641,9643,9647,9766,9777,9817,9885,9887,9904,9917,9920,9929,9932,9935,9968,10011,10039,10042,10045,10048,10051,10057,10138,10142,10150,10153,10263,10268,10272,10344,10360,10384,10393,10406,10412,10420,10428,10437,10448,10490,10573,10579,10608,10611,10663,10668,10671,10833,10880,10989,11003,11018,11019,11026,11029,11031,11067,11068,11069,11156,11159,11162,11164,11166,11168,11170,11172,11286,11329,11337,11374,11396,11438,11460,11513,11515,11536,11545,11550,11719,11738,11743,11746,11749,11752,11759,11768,11805,11808,11826,11829,11854,11860,11887,11908,11917,11931,11956,12035,12039,12042,12073,12082,12085,12089,12093,12204,12211,12225,12229,12230,12233,12237,12251,12254,12274,12315,12316,12343,12349,12352,12361,12387,12409,12565,12567,12572,12574,12577,12586,12759,12765,12787,12882,12883,12952,12986,12988,12993,12996,13053,13116,13149,13157,13170,13187,13194,13261,13283,13286,13399,13438,13484,13487,13537,13539,13550,13626,13639,13642,13688,13695,13704,13724,13755,13813,13833,13851,13876,13879,13882,13902,13908,13943,13949,13970,13991,13994,14029,14031,14032,14036,14038,14044,14067,14087,14088,14089,14090,14091,14092,14093,14112,14113,14117,14145,14148,14157,14207,14208,14257,14266,14268,14298,14299,14300,14301,14302,14303,14333,14352,14362,14366,14370,14393,14395,14396,14397,14398,14399,14401,14410,14476,14478,14481,14486,14494,14532,14533,14535,14537,14539,14540,14550,14642,14682,14688,14852,14877,14884,14887,14888,14889,14890,14891,14892,14893,14895,14919,14920,14921,14922,14959,14973,15041,15071,15084,15091,15106,15115,15119,15137,15140,15155,15256,15279,15283,15297,15372,15378,15415,15482,15492,15556,15560,15648,15767,15795,15802,15826,15840,15853,15854,15855,15867,15896,15902,15938,15942,15945,16024,16036,16046,16073,16080,16089,16091,16132,16133,16134,16135,16136,16227,16229,16375,16382,16386,16451,16477,16481,16723,16729,16744,16759,16768,16769,16773,16774,16779,16795,16799,16826,16865,16868,16869,16873,16874,16878,16880,16889,16918,16921,16978,17159,17212,17375,17383,17427,17435,17472,17493,17494,17495,17496,17497,17533,17556,17709,17710,17711,17712,17713,17715,17843,17845,17847,17865,17924,17938,17940,17941,17942,17943,17947,17993,18037,18041,18065,18093,18094,18095,18097,18098,18099,18109,18112,18144,18152,18176,18179,18197,18199,18223,18226,18239,18273,18299,18302,18352,18390,18413,18445,18468,18516,18570,18575,18648,18704,18709,18728,18737,18786,18788,18796,18823,18824,18825,18866,18874,18882,18883,18884,18885,18886,18887,18888,18890,18993,19083,19084,19153,19210,19276,19292,19294,19301,19303,19339,19346,19403,19409,19421,19426,19472,19478,19501,19535,19580,19582,19689,19695,19710,19723,19804,19814,19842,19860,19867,19904,19911,19919,19923,19976,19989,20211,20221,20228,20245,20258,20261,20267,20271,20298,20328,20360,20415,20464,20465,20475,20483,20484,20518,20526,20592,20647,20698,20703,20764,20802,20810,20814,20866,20868,20874,20885,20901,20907,20915,20973,20976,20979,21036,21078,21079,21140,21243,21258,21390,21391,21392,21393,21394,21395,21396,21397,21404,21454,21477,21478,21479,21480,21481,21482,21483,21607,21738,21746,21838,21839,21840,21841,21842,21843,21844,21845,21846,21847,21896,21901,21906,21911,21921,22041,22051,22056,22071,22086,22239,22244,22249,22250,22251,22252,22253,22434,22437,22440,22449,22492,22641,22645,22647,22648,22655,22659,22660,22662,22663,22703,22713,22764,22781,22792,22798,22805,22835,22872,22885,22890,22950,22978,22986,23033,23037,23105,23336,23341,23347,23432,23468,23533,23538,23557,23571,23582,23605,23609,23632,23639,23648,23725,23755,23916,23922,23932,23961,24006,24141,24207,24366,24383,24466,24544,24546,24712,24864,24898,24976,24979,24989,24997,25020,25027,25050,25090,25293,25294,25329,25652,25770,25773,25879,25882,26034,26044,26045,26046,26047,26048,26054,26060,26062,26063,26064,26065,26066,26102,26103,26115,26116,26120,26231,26244,26251,26258,26271,26352,26376,26390,26401,26415,26422,26558,26605,26616,26621,26695,26696,26702,26783,26882,26989,26992,26995,26998,27001,27004,27172,27193,27206,27209,27212,27215,27218,27221,27225,27226,27260,27265,27266,27267,27280,27287,27299,27323,27327,27334,27337,27341,27343,27345,27348,27354,27357,27395,27421,27456,27471,27479,27498,27508,27536,27598,27599,27601,27602,27607,27609,27610,27611,27612,27801,27813,27819,27825,27851,27854,27895,27907,28001,28009,28057,28067,28068,28069,28070,28071,28072,28086,28107,28110,28115,28118,28129,28144,28152,28192,28202,28212,28218,28232,28243,28406,28422,28424,28485,28499,28506,28590,28651,28672,28686,28687,28688,28691,28717,28757,28766,28769,28777,28794,28810,28811,28812,28813,28814,28815,28816,28856,28865,28868,28871,28873,28991,29077,29128,29193,29217,29737,29738,29929,29957,29970,29972,29973,30037,30041,30047,30063,30078,30090,30092,30094,30137,30157,30167,30220,30224,30228,30233,30239,30243,30247,30256,30268,30288,30292,30297,30302,30347,30418,30428,30455,30456,30457,30458,30510,30518,30549,30634,30743,30747,30759,30792,30805,30807,30822,30843,30975,30989,31006,31007,31038,31064,31075,31079,31112,31117,31128,31154,31163,31164,31165,31166,31167,31168,31218,31231,31249,31251,31355,31356,31363,31364,31365,31366,31368,31372,31374,31500,31501,31502,31503,31515,31516,31517,31518,31519,31520,31555,31719,31725,31734,31740,31747,31753,31764,31768,31773,31779,31794,31800,31816,31823,31833,31848,31867,31873,31878,31885,31892,31904,31932,31933,31934,31936,31961,31962,31964,31969,31975,31980,31983,31986,31990,31991,31994,31999,32100,32114,32118,32119,32171,32178,32185,32287,32289,32321,32322,32323,32325,32364,32453,32649,32695,33039,33052,33054,33055,33057,33058,33072,33128,33132,33138,33159,33160,33161,33162,33163,33164,33165,33166,33198,33229,33232,33234,33237,33279,33322,33325,33393,33403,33405,33409,33411,33415,33431,33446,33469,33484,33485,33487,33488,33522,33633,33654,33655,33658,33679,33707,33734,33819,33859,33929,33944,33945,33951,34021,34031,34033,34036,34039,34042,34056,34057,34059,34060,34094,34144,34157,34160,34191,34194,34201,34208,34215,34299,34305,34504,34509,34532,34543,34557,34623,34631,34635,34643,34657,34684,34698,34700,34724,34728,34734,34737,34740,34747,34763,34769,34795,34882,34890,34929,34948,34957,34958,34959,34960,34961,34962,34963,35064,35069,35088,35097,35106,35115,35133,35163,35168,35173,35178,35183,35212,35215,35276,35281,35282,35336,35345,35354,35363,35372,35381,35494,35495,35496,35497,35498,35499,35500,35529,35536,35537,35538,35539,35540,35541,35542,35675,35823,35912,35918,35924,35930,35985,35986,35987,35988,35999,36007,36018,36025,36046,36101,36237,36244,36313,36314,36315,36316,36317,36318,36319,36425,36451,36452,36455,36459,36548,36562,36567,36694,36696,36708,36711,36714,36717,36729,36781,36815,36826,36831,36839,3

monbauza avatar Mar 15 '18 10:03 monbauza

Please inform the customer of conversation # 324757 when this conversation has been closed.

monbauza avatar Mar 15 '18 10:03 monbauza

The above customer provided the following error log:

[Fri Mar 09 04:33:12.711505 2018] [:error] [pid 12101] [client 208.189.220.38:60853] KILLED QUERY (39671 characters long generated in /xxxxxx/wp-content/plugins/wordpress-seo-premium/premium/classes/premium-orphaned-post-query.php:37): SELECT COUNT( ID ) as total_orphaned, post_type\n\t\t\t\t\t\tFROM 420_posts\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tID IN ( 33,52,68,69,70,82,95,165,166,167,168,5361,5363,5365,5367,5421,5422,5423,5424,5425,5426,5427,5428,5429,5430,5431,5432,5433,5434,5435,5436,5437,5438,5439,5440,5441,5442,5443,5444,5445,5446,5447,5448,5449,5450,5451,5452,5453,5454,5455,5456,5457,5458,5459,5460,5461,5462,5463,5464,5465,5466,5467,5468,5469,5470,5471,5472,5473,5474,5475,5476,5477,5478,5479,5480,5481,5482,5483,5484,5485,5486,5487,5488,5489,5490,5491,5492,5493,5494,5495,5496,5497,5498,5499,5500,5501,5502,5503,5504,5505,5506,5507,5508,5509,5510,5511,5512,5513,5514,5515,5516,5517,5518,5519,5520,5521,5522,5523,5524,5525,5526,5527,5528,5529,5530,5531,5532,5533,5534,5535,5536,5537,5538,5539,5540,5541,5542,5543,5544,5545,5546,5547,5548,5549,5550,5551,5552,5553,5554,5555,5556,5557,5558,5559,5560,5561,5562,5563,5564,5565,5566,5567,5568,5569,5570,5571,5572,5573,5574,5575,5576,5577,5578,5579,5580,5581,5582,5583,5584,5585,5586,5587,5588,5589,5590,5591,5592,5593,5594,5595,5596,5597,5598,5599,5600,5601,5602,5603,5604,5605,5606,5607,5608,5609,5610,5611,5612,5613,5614,5615,5616,5617,5618,5619,5620,5621,5622,5623,5624,5625,5626,5627,5628,5629,5630,5631,5632,5633,5634,5635,5636,5637,5638,5639,5640,5641,5642,5643,5644,5645,5646,5647,5648,5649,5650,5651,5652,5653,5654,5655,5656,5657,5658,5659,5660,5661,5662,5663,5664,5665,5666,5667,5668,5669,5670,5671,5672,5673,5674,5675,5766,5767,5768,5769,5770,5771,5772,5773,5774,5775,5776,5777,5778,5779,5780,5781,5782,5783,5784,5785,5786,5787,5788,5789,5790,5791,5792,5793,5794,5795,5796,5797,5798,5799,5800,5801,5802,5803,5804,5805,5806,5807,5808,5809,5810,5811,5812,5813,5814,5815,5816,5817,5818,5819,5820,5821,5822,5823,5824,5825,5826,5827,5828,5829,5830,5831,5832,5833,5834,5835,5836,5837,5838,5839,5840,5841,5842,5843,5844,5845,5846,5847,5848,5849,5850,5851,5852,5853,5854,5855,5856,5857,5858,5859,5860,5861,5862,5863,5864,5865,5866,5867,5868,5869,5870,5871,5872,5873,5874,5875,5876,5877,5878,5879,5880,5881,5882,5883,5884,5885,5886,5887,5888,5889,5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,5900,5901,5902,5903,5904,5905,5906,5907,5908,5909,5910,5911,5912,5913,5914,5915,5916,5917,5918,5919,5920,5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,5936,5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949,5950,5951,5952,5953,5954,5955,5956,5957,5958,5959,5960,5961,5962,5963,5964,5965,5966,5967,5968,5969,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,5980,5981,5982,5983,5984,5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999,6000,6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016,6017,6018,6019,6020,6021,6022,6023,6024,6025,6026,6027,6028,6029,6030,6031,6032,6033,6034,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045,6046,6047,6048,6049,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064,6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,6083,6084,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096,6097,6098,6099,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6114,6115,6116,6117,6118,6119,6120,6121,6122,6123,6124,6125,6126,6127,6128,6129,6130,6131,6132,6133,6134,6135,6136,6137,6138,6139,6140,6141,6142,6143,6144,6145,6146,6147,6148,6149,6150,6151,6152,6153,6154,6155,6156,6157,6158,6159,6160,6161,6162,6163,6164,6165,6166,6167,6168,6169,6170,6171,6172,6173,6174,6286,6287,6288,6289,6290,6291,6292,6293,6294,6295,6296,6297,6298,6299,6300,6301,6302,6303,6304,6305,6306,6307,6308,6309,6310,6311,6312,6313,6314,6315,6316,6317,6318,6319,6320,6321,6322,6323,6324,6325,6326,6327,6328,6329,6330,6331,6332,6333,6334,6335,6336,6337,6338,6339,6340,6341,6342,6343,6344,6345,6346,6347,6348,6349,6350,6351,6352,6353,6354,6355,6356,6357,6358,6359,6360,6361,6362,6363,6364,6365,6366,6367,6368,6369,6370,6371,6372,6373,6374,6375,6376,6377,6378,6379,6380,6381,6382,6383,6384,6385,6386,6387,6388,6389,6390,6391,6392,6393,6394,6395,6396,6397,6398,6399,6400,6401,6402,6403,6404,6405,6406,6407,6408,6409,6410,6411,6412,6413,6414,6415,6416,6417,6418,6419,6420,6421,6422,6423,6424,6425,6426,6427,6428,6429,6430,6431,6432,6433,6434,6435,6436,6437,6438,6439,6440,6441,6442,6443,6444,6445,6446,6447,6448,6449,6450,6451,6452,6453,6454,6455,6456,6457,6458,6459,6460,6461,6462,6463,6464,6465,6466,6467,6468,6469,6470,6471,6472,6473,6474,6475,6476,6477,6478,6479,6480,6481,6482,6483,6484,6485,6486,6487,6488,6489,6490,6491,6492,6493,6494,6495,6496,6497,6498,6499,6500,6501,6502,6503,6504,6505,6506,6507,6508,6509,6510,6511,6512,6513,6514,6515,6516,6517,6518,6519,6520,6521,6522,6523,6524,6525,6526,6527,6528,6529,6530,6531,6532,6533,6534,6535,6536,6537,6538,6539,6540,6541,6542,6543,6544,6545,6546,6547,6548,6549,6550,6551,6552,6553,6554,6555,6556,6557,6558,6559,6560,6561,6562,6563,6564,6565,6566,6567,6568,6569,6570,6571,6572,6573,6574,6575,6576,6577,6578,6579,6580,6581,6582,6583,6584,6585,6586,6587,6588,6589,6590,6591,6592,6593,6594,6595,6596,6597,6598,6599,6600,6601,6602,6603,6604,6605,6606,6607,6608,6609,6610,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,6622,6623,6624,6625,6626,6627,6628,6629,6630,6631,6632,6633,6634,6635,6636,6637,6638,6639,6640,6641,6642,6643,6644,6645,6646,6647,6648,6649,6650,6651,6652,6653,6654,6655,6656,6657,6658,6659,6660,6661,6662,6663,6664,6665,6666,6667,6668,6669,6670,6671,6672,6673,6674,6675,6676,6677,6678,6679,6680,6681,6682,6683,6684,6685,6686,6687,6688,6689,6690,6691,6692,6693,6694,6695,6696,6697,6698,6699,6700,6701,6702,6703,6704,6705,6706,6707,6708,6709,6710,6711,6712,6713,6714,6715,6716,6717,6718,6719,6720,6721,6722,6723,6724,6725,6726,6727,6728,6729,6730,6731,6732,6733,6734,6735,6736,6737,6738,6739,6740,6741,6742,6743,6744,6745,6746,6747,6748,6749,6750,6751,6752,6753,6754,6755,6756,6757,6758,6759,6760,6761,6762,6763,6764,6765,6766,6767,6768,6769,6770,6771,6772,6773,6774,6775,6776,6777,6778,6779,6780,6781,6782,6783,6784,6785,6786,6787,6788,6789,6790,6791,6792,6793,6794,6795,6796,6797,6798,6799,6800,6801,6802,6803,6804,6805,6806,6807,6808,6809,6810,6811,6812,6813,6814,6815,6816,6817,6818,6819,6820,6821,6822,6823,6824,6825,6826,6827,6828,6829,6830,6831,6832,6833,6834,6835,6836,6837,6838,6839,6840,6841,6842,6843,6844,6845,6846,6847,6848,6849,6850,6851,6852,6853,6854,6855,6856,6857,6858,6859,6860,6861,6862,6863,6864,6865,6866,6867,6868,6869,6870,6871,6872,6873,6874,6875,6876,6877,6878,6879,6880,6881,6882,6883,6884,6885,6886,6887,6888,6889,6890,6891,6892,6893,6894,6895,6896,6897,6898,6899,6900,6901,6902,6903,6904,6905,6906,6907,6908,6909,6910,6911,6912,6913,6914,6915,6916,6917,6918,6919,6920,6921,6922,6923,6924,6925,6926,6927,6928,6929,6930,6931,6932,6933,6934,6935,6936,6937,6938,6939,6940,6941,6942,6943,6944,6945,6946,6947,6948,6949,6950,6951,6952,6953,6954,6955,6956,6957,6958,6959,6960,6961,6962,6963,6964,6965,6966,6967,6968,6969,6970,6971,6972,6973,6974,6975,6976,6977,6978,6979,6980,6981,6982,6983,6984,6985,6986,6987,6988,6989,6990,6991,6992,6993,6994,6995,6996,6997,6998,6999,7000,7001,7002,7003,7004,7005,7006,7007,7008,7009,7010,7011,7012,7013,7014,7015,7016,7017,7018,7019,7020,7021,7022,7023,7024,7025,7026,7027,7028,7029,7030,7031,7032,7033,7034,7035,7036,7037,7038,7039,7040,7041,7042,7043,7044,7045,7046,7047,7048,7049,7050,7051,7052,7053,7054,7055,7056,7057,7058,7059,7060,7061,7062,7063,7064,7065,7066,7067,7068,7069,7070,7071,7072,7073,7074,7075,7076,7077,7078,7079,7080,7081,7082,7083,7084,7085,7086,7087,7088,7089,7090,7091,7092,7093,7094,7095,7096,7097,7098,7099,7100,7101,7102,7103,7104,7105,7106,7107,7108,7109,7110,7111,7112,7113,7114,7115,7116,7117,7118,7119,7120,7121,7122,7123,7124,7125,7126,7127,7128,7129,7130,7131,7132,7133,7134,7135,7136,7137,7138,7139,7140,7141,7142,7143,7144,7145,7146,7147,7148,7149,7150,7151,7152,7153,7154,7155,7156,7157,7158,7159,7160,7161,7162,7163,7164,7165,7166,7167,7168,7169,7170,7171,7172,
[Fri Mar 09 04:37:56.318415 2018] [:error] [pid 28929] [client 208.189.220.38:63499] KILLED QUERY (39508 characters long generated in /xxxxxx/wp-content/plugins/wordpress-seo-premium/premium/classes/premium-orphaned-post-filter.php:167): SELECT COUNT(ID)\n\t\t\t\t\tFROM `420_posts`\n\t\t\t\t\tWHERE ID IN ( 33,52,68,69,70,82,95,165,166,167,168,5361,5363,5365,5367,5421,5422,5423,5424,5425,5426,5427,5428,5429,5430,5431,5432,5433,5434,5435,5436,5437,5438,5439,5440,5441,5442,5443,5444,5445,5446,5447,5448,5449,5450,5451,5452,5453,5454,5455,5456,5457,5458,5459,5460,5461,5462,5463,5464,5465,5466,5467,5468,5469,5470,5471,5472,5473,5474,5475,5476,5477,5478,5479,5480,5481,5482,5483,5484,5485,5486,5487,5488,5489,5490,5491,5492,5493,5494,5495,5496,5497,5498,5499,5500,5501,5502,5503,5504,5505,5506,5507,5508,5509,5510,5511,5512,5513,5514,5515,5516,5517,5518,5519,5520,5521,5522,5523,5524,5525,5526,5527,5528,5529,5530,5531,5532,5533,5534,5535,5536,5537,5538,5539,5540,5541,5542,5543,5544,5545,5546,5547,5548,5549,5550,5551,5552,5553,5554,5555,5556,5557,5558,5559,5560,5561,5562,5563,5564,5565,5566,5567,5568,5569,5570,5571,5572,5573,5574,5575,5576,5577,5578,5579,5580,5581,5582,5583,5584,5585,5586,5587,5588,5589,5590,5591,5592,5593,5594,5595,5596,5597,5598,5599,5600,5601,5602,5603,5604,5605,5606,5607,5608,5609,5610,5611,5612,5613,5614,5615,5616,5617,5618,5619,5620,5621,5622,5623,5624,5625,5626,5627,5628,5629,5630,5631,5632,5633,5634,5635,5636,5637,5638,5639,5640,5641,5642,5643,5644,5645,5646,5647,5648,5649,5650,5651,5652,5653,5654,5655,5656,5657,5658,5659,5660,5661,5662,5663,5664,5665,5666,5667,5668,5669,5670,5671,5672,5673,5674,5675,5766,5767,5768,5769,5770,5771,5772,5773,5774,5775,5776,5777,5778,5779,5780,5781,5782,5783,5784,5785,5786,5787,5788,5789,5790,5791,5792,5793,5794,5795,5796,5797,5798,5799,5800,5801,5802,5803,5804,5805,5806,5807,5808,5809,5810,5811,5812,5813,5814,5815,5816,5817,5818,5819,5820,5821,5822,5823,5824,5825,5826,5827,5828,5829,5830,5831,5832,5833,5834,5835,5836,5837,5838,5839,5840,5841,5842,5843,5844,5845,5846,5847,5848,5849,5850,5851,5852,5853,5854,5855,5856,5857,5858,5859,5860,5861,5862,5863,5864,5865,5866,5867,5868,5869,5870,5871,5872,5873,5874,5875,5876,5877,5878,5879,5880,5881,5882,5883,5884,5885,5886,5887,5888,5889,5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,5900,5901,5902,5903,5904,5905,5906,5907,5908,5909,5910,5911,5912,5913,5914,5915,5916,5917,5918,5919,5920,5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,5936,5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949,5950,5951,5952,5953,5954,5955,5956,5957,5958,5959,5960,5961,5962,5963,5964,5965,5966,5967,5968,5969,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,5980,5981,5982,5983,5984,5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999,6000,6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016,6017,6018,6019,6020,6021,6022,6023,6024,6025,6026,6027,6028,6029,6030,6031,6032,6033,6034,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045,6046,6047,6048,6049,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064,6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,6083,6084,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096,6097,6098,6099,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6114,6115,6116,6117,6118,6119,6120,6121,6122,6123,6124,6125,6126,6127,6128,6129,6130,6131,6132,6133,6134,6135,6136,6137,6138,6139,6140,6141,6142,6143,6144,6145,6146,6147,6148,6149,6150,6151,6152,6153,6154,6155,6156,6157,6158,6159,6160,6161,6162,6163,6164,6165,6166,6167,6168,6169,6170,6171,6172,6173,6174,6286,6287,6288,6289,6290,6291,6292,6293,6294,6295,6296,6297,6298,6299,6300,6301,6302,6303,6304,6305,6306,6307,6308,6309,6310,6311,6312,6313,6314,6315,6316,6317,6318,6319,6320,6321,6322,6323,6324,6325,6326,6327,6328,6329,6330,6331,6332,6333,6334,6335,6336,6337,6338,6339,6340,6341,6342,6343,6344,6345,6346,6347,6348,6349,6350,6351,6352,6353,6354,6355,6356,6357,6358,6359,6360,6361,6362,6363,6364,6365,6366,6367,6368,6369,6370,6371,6372,6373,6374,6375,6376,6377,6378,6379,6380,6381,6382,6383,6384,6385,6386,6387,6388,6389,6390,6391,6392,6393,6394,6395,6396,6397,6398,6399,6400,6401,6402,6403,6404,6405,6406,6407,6408,6409,6410,6411,6412,6413,6414,6415,6416,6417,6418,6419,6420,6421,6422,6423,6424,6425,6426,6427,6428,6429,6430,6431,6432,6433,6434,6435,6436,6437,6438,6439,6440,6441,6442,6443,6444,6445,6446,6447,6448,6449,6450,6451,6452,6453,6454,6455,6456,6457,6458,6459,6460,6461,6462,6463,6464,6465,6466,6467,6468,6469,6470,6471,6472,6473,6474,6475,6476,6477,6478,6479,6480,6481,6482,6483,6484,6485,6486,6487,6488,6489,6490,6491,6492,6493,6494,6495,6496,6497,6498,6499,6500,6501,6502,6503,6504,6505,6506,6507,6508,6509,6510,6511,6512,6513,6514,6515,6516,6517,6518,6519,6520,6521,6522,6523,6524,6525,6526,6527,6528,6529,6530,6531,6532,6533,6534,6535,6536,6537,6538,6539,6540,6541,6542,6543,6544,6545,6546,6547,6548,6549,6550,6551,6552,6553,6554,6555,6556,6557,6558,6559,6560,6561,6562,6563,6564,6565,6566,6567,6568,6569,6570,6571,6572,6573,6574,6575,6576,6577,6578,6579,6580,6581,6582,6583,6584,6585,6586,6587,6588,6589,6590,6591,6592,6593,6594,6595,6596,6597,6598,6599,6600,6601,6602,6603,6604,6605,6606,6607,6608,6609,6610,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,6622,6623,6624,6625,6626,6627,6628,6629,6630,6631,6632,6633,6634,6635,6636,6637,6638,6639,6640,6641,6642,6643,6644,6645,6646,6647,6648,6649,6650,6651,6652,6653,6654,6655,6656,6657,6658,6659,6660,6661,6662,6663,6664,6665,6666,6667,6668,6669,6670,6671,6672,6673,6674,6675,6676,6677,6678,6679,6680,6681,6682,6683,6684,6685,6686,6687,6688,6689,6690,6691,6692,6693,6694,6695,6696,6697,6698,6699,6700,6701,6702,6703,6704,6705,6706,6707,6708,6709,6710,6711,6712,6713,6714,6715,6716,6717,6718,6719,6720,6721,6722,6723,6724,6725,6726,6727,6728,6729,6730,6731,6732,6733,6734,6735,6736,6737,6738,6739,6740,6741,6742,6743,6744,6745,6746,6747,6748,6749,6750,6751,6752,6753,6754,6755,6756,6757,6758,6759,6760,6761,6762,6763,6764,6765,6766,6767,6768,6769,6770,6771,6772,6773,6774,6775,6776,6777,6778,6779,6780,6781,6782,6783,6784,6785,6786,6787,6788,6789,6790,6791,6792,6793,6794,6795,6796,6797,6798,6799,6800,6801,6802,6803,6804,6805,6806,6807,6808,6809,6810,6811,6812,6813,6814,6815,6816,6817,6818,6819,6820,6821,6822,6823,6824,6825,6826,6827,6828,6829,6830,6831,6832,6833,6834,6835,6836,6837,6838,6839,6840,6841,6842,6843,6844,6845,6846,6847,6848,6849,6850,6851,6852,6853,6854,6855,6856,6857,6858,6859,6860,6861,6862,6863,6864,6865,6866,6867,6868,6869,6870,6871,6872,6873,6874,6875,6876,6877,6878,6879,6880,6881,6882,6883,6884,6885,6886,6887,6888,6889,6890,6891,6892,6893,6894,6895,6896,6897,6898,6899,6900,6901,6902,6903,6904,6905,6906,6907,6908,6909,6910,6911,6912,6913,6914,6915,6916,6917,6918,6919,6920,6921,6922,6923,6924,6925,6926,6927,6928,6929,6930,6931,6932,6933,6934,6935,6936,6937,6938,6939,6940,6941,6942,6943,6944,6945,6946,6947,6948,6949,6950,6951,6952,6953,6954,6955,6956,6957,6958,6959,6960,6961,6962,6963,6964,6965,6966,6967,6968,6969,6970,6971,6972,6973,6974,6975,6976,6977,6978,6979,6980,6981,6982,6983,6984,6985,6986,6987,6988,6989,6990,6991,6992,6993,6994,6995,6996,6997,6998,6999,7000,7001,7002,7003,7004,7005,7006,7007,7008,7009,7010,7011,7012,7013,7014,7015,7016,7017,7018,7019,7020,7021,7022,7023,7024,7025,7026,7027,7028,7029,7030,7031,7032,7033,7034,7035,7036,7037,7038,7039,7040,7041,7042,7043,7044,7045,7046,7047,7048,7049,7050,7051,7052,7053,7054,7055,7056,7057,7058,7059,7060,7061,7062,7063,7064,7065,7066,7067,7068,7069,7070,7071,7072,7073,7074,7075,7076,7077,7078,7079,7080,7081,7082,7083,7084,7085,7086,7087,7088,7089,7090,7091,7092,7093,7094,7095,7096,7097,7098,7099,7100,7101,7102,7103,7104,7105,7106,7107,7108,7109,7110,7111,7112,7113,7114,7115,7116,7117,7118,7119,7120,7121,7122,7123,7124,7125,7126,7127,7128,7129,7130,7131,7132,7133,7134,7135,7136,7137,7138,7139,7140,7141,7142,7143,7144,7145,7146,7147,7148,7149,7150,7151,7152,7153,7154,7155,7156,7157,7158,7159,7160,7161,7162,7163,7164,7165,7166,7167,7168,7169,7170,7171,7172,7173,7174,7175,7176,7177,7178,7179,7180,7181,7

monbauza avatar Mar 15 '18 10:03 monbauza

Hi,

How do you exclude posts by post type?

It is killing one my sites.

KILLED QUERY (997666 characters long generated wp-content/plugins/wordpress-seo-premium/premium/classes/premium-orphaned-post-query.php:35): SELECT COUNT( ID ) as total_orphaned, post_type FROM wp_posts WHERE ID IN ( = like a million id queries

champsupertramp avatar May 17 '18 10:05 champsupertramp

Please inform the customer of conversation # 368784 when this conversation has been closed.

monbauza avatar May 18 '18 08:05 monbauza

We've received another report from a WPEngine user. In this case the query that was killed has the following info:

[Mon May 21 22:37:06.142386 2018] [:error] [pid 9770] [client 104.154.220.196:47378] KILLED QUERY (167664 characters long generated in /xxxxxxx/wp-content/plugins/wordpress-seo-premium/inc/sitemaps/class-taxonomy-sitemap-provider.php:68): SELECT t

Looking through previous tickets, WPEngine has replied with the following info:

[ERROR] KILL QUERY:

Used to determine which queries of SELECT Statements have been killed and not executed by WP Engine due to the query length being over 16k characters; which is inefficient and should not be ran on a production database.

EXAMPLE:

[Wed Mar 26 06:26:19 2014] [error] [client 127.0.0.1] KILLED QUERY: SELECT DISTINCT user.ID AS user_id, t.* FROM …

We have included it in the log to identify a query that was killed and not executed by WP Engine due to the length of the query being over 16k characters, which is inefficient and should not be run on a production database. These only apply to Select statements, and not any other type of statements. If these queries need to be run, they should be done so on a local copy of the database that can be downloaded from any backup point in the User Portal. This can be resource intensive; which is why we've provided this log.

rmarcano avatar May 22 '18 18:05 rmarcano

Please inform the customer of conversation # 372022 when this conversation has been closed.

rmarcano avatar May 22 '18 18:05 rmarcano

Please inform the customer of conversation # 378434 when this conversation has been closed.

monbauza avatar Jun 04 '18 07:06 monbauza

Please inform the customer of conversation # 383488 when this conversation has been closed.

mmikhan avatar Jun 10 '18 21:06 mmikhan

KILLED QUERY (30031 characters long generated in /nas/content/live/thedp/wp-content/plugins/wordpress-seo-premium/premium/classes/premium-orphaned-post-filter.php:181):

SELECT COUNT(ID)\n\t\t\t\t\tFROM `wpd_posts`\n\t\t\t\t\tWHERE ID IN ( 10,11,15,24,26,29,32,34,35,36,42,44,45,46,47,48,50,51,57,59,61,66,67,79,80,81,87,88,89,96,101,105,107,112,121,135,144,146,169,179,186,188,197,199,204,210,213,223,229,248,260,270,275,279,519,776,780,785,831,923,991,1199,1206,1298,1338,1339,1340,1379,1381,1453,1479,1483,1504,1514,1521,1526,1533,1539,1557,1562,1566,1572,1576,1585,1600,1605,1612,1617,1624,1628,1639,1646,1654,1662,1676,1677,1679,1689,1694,1700,1715,1772,1802,1804,1818,1839,1850,1854,1858,1871,1876,1878,1880,1899,1900,1913,1916,1932,1946,2000,2019,2025,2029,2031,2130,2132,2135,2146,2198,2254,2256,2259,2262,2264,2377,2388,2423,2456,2517,2519,2538,2562,2576,2578,2607,2617,2624,2647,2654,2664,2666,2681,2689,2712,2759,2784,2804,2809,2826,2841,2843,2844,2846,2851,2852,2853,2872,2891,2893,2908,2912,2920,2924,2932,2940,2944,2950,2978,2982,2985,2990,2998,3005,3015,3016,3017,3018,3083,3091,3096,3229,3239,3248,3249,3278,3283,3285,3291,3298,3304,3310,3318,3323,3327,3333,3334,3340,3356,3375,3382,3388,3390,3419,3424,3428,3436,3440,3450,3454,3463,3466,3474,3481,3486,3491,3496,3501,3510,3519,3524,3532,3548,3555,3560,3573,3578,3584,3587,3602,3644,3654,3662,3663,3685,3690,3700,3704,3705,3706,3723,3738,3771,3782,3830,3842,3860,3864,3903,3904,3914,3946,3952,3973,3994,4009,4019,4029,4052,4057,4086,4088,4097,4123,4127,4151,4200,4218,4230,4242,4257,4265,4270,4285,4298,4343,4363,4370,4391,4433,4465,4486,4499,4527,4530,4531,4540,4550,4553,4572,4583,4593,4605,4606,4617,4619,4621,4649,4678,4706,4718,4729,4757,4769,4771,4789,4814,4825,4846,4853,4858,4862,4885,4902,4903,4923,4938,4984,5009,5052,5077,5102,5113,5132,5142,5146,5150,5172,5181,5191,5202,5220,5226,5275,5278,5281,5288,5304,5313,5327,5333,5345,5359,5364,5375,5378,5381,5403,5408,5423,5431,5437,5472,5478,5489,5499,5501,5531,5541,5567,5576,5611,5683,5692,5699,5726,5748,5763,5804,5837,5838,5848,5873,5880,5895,5899,5918,5927,5930,5952,5963,5966,5974,5975,5979,5997,6012,6014,6024,6027,6029,6038,6040,6048,6055,6059,6063,6067,6071,6075,6079,6084,6088,6092,6096,6100,6104,6127,6155,6157,6162,6165,6168,6173,6179,6190,6221,6225,6229,6233,6238,6242,6246,6250,6254,6267,6273,6277,6282,6286,6290,6294,6298,6302,6306,6310,6337,6376,6378,6409,6427,6438,6446,6456,6489,6492,6499,6540,6579,6594,6603,6618,6629,6653,6658,6673,6680,6689,6697,6726,6733,6850,6893,6909,6914,6942,6959,6971,7009,7021,7025,7042,7048,7083,7093,7099,7113,7118,7131,7141,7148,7171,7187,7194,7201,7214,7245,7252,7260,7271,7287,7312,7318,7329,7332,7390,7422,7442,7448,7479,7486,7488,7489,7494,7511,7521,7554,7565,7571,7581,7589,7596,7601,7615,7624,7633,7645,7658,7681,7684,7689,7697,7710,7723,7729,7744,7755,7766,7780,7790,7806,7811,7817,7822,7823,7848,7851,7860,7869,7888,7893,7906,7911,7929,7933,7940,7957,7961,7976,7985,7988,7999,8033,8035,8046,8053,8062,8078,8081,8095,8101,8103,8110,8152,8156,8166,8171,8182,8206,8215,8234,8238,8241,8248,8251,8274,8307,8310,8342,8357,8359,8361,8365,8367,8377,8432,8437,8438,8447,8453,8455,8457,8458,8459,8460,8463,8465,8473,8475,8477,8481,8483,8485,8486,8491,8495,8497,8501,8505,8509,8511,8525,8535,8541,8543,8545,8547,8557,8563,8565,8571,8581,8585,8595,8599,8600,8603,8611,8619,8623,8625,8627,8628,8629,8635,8639,8641,8643,8645,8652,8657,8714,8749,8766,8777,8806,8810,8817,8858,8890,8895,8906,8914,8931,8940,8944,8948,8950,8954,8956,8958,8960,8968,8970,8972,8973,8974,8976,8978,8984,8990,8992,8994,8996,8997,8998,9000,9002,9004,9006,9008,9026,9055,9062,9088,9108,9111,9125,9129,9137,9152,9158,9183,9191,9213,9216,9294,9297,9298,9299,9308,9314,9324,9326,9330,9334,9342,9360,9392,9400,9403,9410,9419,9428,9435,9437,9466,9485,9494,9509,9514,9520,9534,9541,9553,9562,9568,9573,9613,9614,9615,9616,9823,9827,9831,9833,9835```

mmikhan avatar Jun 10 '18 21:06 mmikhan

Might I suggest simply doing this in batches of a limited number of post ids?

Been seeing this for months, glad to know I'm not the only one.

danieliser avatar Jul 14 '18 21:07 danieliser

[Sat Aug 04 01:17:36.478152 2018] [:error] [pid 27672] [client 173.79.11.226:17198] KILLED QUERY (58164 characters long generated in /nas/content/live/ctovision/wp-content/plugins/wordpress-seo-premium/premium/classes/premium-orphaned-post-filter.php:179):

SELECT COUNT(ID)\n\t\t\t\t\tFROM `wp_posts`\n\t\t\t\t\tWHERE ID IN ( 5,6,9,10,11,16,19,21,22,23,24,25,26,27,28,30,31,34,36,37,38,39,40,42,44,45,46,48,50,51,52,54,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,76,77,79,80,81,82,83,84,85,86,87,89,90,91,92,94,96,97,98,99,101,103,104,110,111,113,115,116,117,119,120,122,123,124,125,126,127,128,129,130,131,132,133,135,137,138,139,140,141,142,144,145,146,147,175,177,179,181,184,190,199,202,245,264,269,272,273,276,279,285,301,313,326,328,348,356,368,378,398,436,478,488,493,497,512,526,530,548,559,579,869,919,925,942,950,961,1035,1059,1064,1087,1093,1109,1127,1129,1133,1166,1206,1213,1215,1233,1240,1250,1286,1291,1296,1304,1306,1311,1316,1322,1330,1339,1344,1350,1365,1368,1376,1384,1387,1395,1404,1438,1476,1524,1527,1541,1545,1556,1580,1586,1593,1607,1614,1622,1624,1653,1672,1674,1689,1707,1715,1720,1730,1735,1739,1748,1794,1798,1816,1835,1847,1850,1871,1879,1887,1892,1897,1919,1939,1984,1993,2021,2027,2067,2070,2073,2075,2077,2080,2083,2087,2091,2093,2095,2098,2182,2188,2194,2201,2205,2244,2251,2263,2267,2271,2284,2311,2318,2321,2339,2350,2363,2371,2378,2383,2400,2405,2409,2457,2468,2492,2496,2512,2529,3023,4633,5389,6328,7035,7037,7120,7153,7536,7876,8849,9001,9012,9275,9303,10304,10943,10975,11012,11022,11086,11132,11173,11227,11231,11266,11285,11343,11347,11382,11406,11422,11475,11487,11508,11556,11582,11590,11657,11688,11745,11754,11798,11840,11871,11881,11892,11894,11939,11953,11959,11977,12004,12026,12036,12095,12116,12134,12146,12151,12161,12168,12184,12236,12242,12249,12293,12304,12322,12326,12338,12343,12356,12371,12385,12397,12413,12421,12431,12441,12446,12458,12471,12475,12495,12500,12511,12522,12525,12532,12537,12564,12585,12591,12600,12617,12626,12635,12639,12643,12653,12666,12672,12685,12708,12712,12722,12753,12763,12777,12786,12803,12819,12868,12873,12878,12897,12910,12913,12932,12944,12949,12968,12980,12986,12991,13047,13070,13077,13082,13090,13101,13106,13111,13118,13123,13129,13132,13144,13147,13170,13191,13193,13197,13207,13216,13248,13263,13295,13311,13321,13336,13347,13358,13435,13452,13462,13471,13498,13519,13521,13546,13556,13558,13562,13572,13595,13615,13629,13640,13667,13680,13692,13699,13709,13724,13726,13755,13771,13798,13822,13830,13838,13850,13861,13867,13879,13907,13932,13951,13961,13977,13983,13989,13992,14002,14011,14031,14053,14066,14069,14079,14084,14095,14109,14119,14124,14128,14136,14145,14175,14182,14189,14198,14224,14248,14278,14285,14289,14305,14314,14336,14339,14369,14380,14390,14397,14402,14406,14408,14428,14444,14445,14452,14475,14477,14478,14482,14487,14511,14518,14532,14537,14554,14559,14591,14599,14633,14670,14686,14690,14698,14706,14725,14726,14769,14801,14813,14817,14841,14847,14859,14910,14926,14948,14959,14991,15027,15043,15044,15108,15125,15142,15161,15173,15190,15191,15225,15238,15252,15266,15270,15284,15320,15346,15374,15383,15389,15394,15395,15411,15427,15469,15475,15488,15509,15524,15534,15551,15557,15567,15572,15611,15627,15629,15631,15645,15650,15658,15680,15688,15748,15754,15755,15764,15793,15818,15834,15848,15853,15891,15904,15905,15928,15935,15956,15963,15966,15967,15975,15987,15988,16003,16018,16029,16030,16050,16057,16061,16064,16066,16081,16082,16084,16088,16091,16098,16116,16139,16156,16160,16166,16167,16171,16188,16201,16206,16216,16220,16225,16232,16233,16237,16245,16246,16249,16256,16262,16281,16295,16297,16303,16323,16333,16337,16340,16363,16367,16374,16380,16385,16388,16392,16402,16412,16413,16417,16447,16464,16465,16490,16499,16517,16540,16542,16553,16566,16577,16580,16587,16595,16612,16630,16647,16659,16671,16689,16690,16707,16732,16747,16754,16758,16763,16770,16773,16782,16783,16787,16788,16792,16793,16796,16820,16841,16858,16866,16868,16879,16891,16900,16913,16923,16924,16937,16939,16950,16960,16962,16966,16971,16978,16979,16981,16985,16988,17015,17026,17033,17038,17046,17049,17052,17062,17073,17077,17085,17090,17094,17097,17099,17129,17156,17195,17226,17235,17240,17252,17281,17290,17292,17301,17311,17316,17331,17336,17347,17354,17359,17364,17372,17379,17383,17403,17406,17408,17410,17414,17418,17435,17445,17446,17447,17449,18825,18833,18835,18838,18839,18848,18858,18895,18921,18928,18934,18939,18961,18968,18994,18997,19006,19011,19034,19052,19056,19070,19074,19087,19091,19096,19108,19111,19118,19122,19144,19148,19150,19176,19183,19186,19193,19198,19216,19230,19248,19256,19268,19280,19292,19303,19311,19321,19337,19343,19350,19356,19369,19380,19383,19407,19412,19420,19434,19440,19450,19453,19459,19463,19470,19471,19482,19483,19487,19490,19499,19515,19536,19540,19556,19560,19563,19569,19572,19583,19588,19596,19613,19617,19624,19630,19634,19649,19654,19658,19661,19669,19677,19683,19691,19700,19708,19715,19725,19731,19733,19739,19763,19766,19768,19779,19787,19791,19800,19825,19839,19864,19882,19888,19892,19902,19905,19915,19919,19923,19927,19943,19955,19965,19968,19969,19983,19997,20022,20026,20032,20033,20038,20049,20061,20068,20072,20091,20092,20100,20117,20118,20123,20129,20132,20135,20139,20144,20150,20154,20156,20170,20174,20179,20190,20193,20201,20221,20232,20239,20248,20254,20265,20275,20286,20289,20293,20304,20309,20317,20325,20341,20354,20362,20367,20378,20387,20392,20419,20421,20436,20439,20440,20463,20467,20470,20474,20484,20491,20492,20501,20505,20519,20524,20526,20530,20538,20547,20561,20570,20574,20582,20591,20599,20606,20609,20616,20624,20625,20629,20637,20640,20643,20649,20650,20654,20668,20673,20680,20684,20691,20697,20703,20711,20725,20733,20737,20747,20760,20765,20776,20783,20789,20794,20806,20811,20816,20824,20836,20837,20843,20850,20858,20859,20876,20881,20885,20888,20890,20892,20894,20895,20900,20903,20906,20907,20910,20927,20931,20934,20937,20953,20958,20962,20968,20979,20982,20987,20993,20997,21002,21006,21013,21016,21022,21028,21040,21047,21053,21056,21061,21062,21073,21088,21106,21129,21135,21138,21141,21158,21163,21167,21180,21182,21193,21204,21210,21223,21232,21242,21246,21251,21259,21271,21282,21285,21309,21341,21345,21353,21355,21361,21363,21367,21385,21392,21395,21396,21405,21408,21411,21413,21415,21417,21418,21421,21424,21426,21427,21438,21439,21444,21448,21451,21457,21459,21462,21466,21468,21470,21474,21477,21481,21485,21502,21511,21520,21524,21525,21531,21534,21537,21552,21554,21557,21558,21567,21568,21571,21575,21581,21585,21588,21591,21594,21600,21607,21608,21610,21614,21616,21618,21621,21624,21626,21627,21634,21637,21640,21642,21644,21647,21651,21653,21655,21659,21662,21663,21665,21666,21667,21669,21673,21676,21677,21684,21685,21687,21693,21695,21696,21698,21699,21701,21709,21715,21717,21719,21723,21725,21727,21728,21739,21742,21751,21757,21766,21769,21770,21775,21784,21792,21797,21798,21800,21805,21807,21809,21814,21818,21822,21825,21834,21837,21838,21848,21851,21854,21857,21860,21863,21883,21889,21894,21897,21900,21906,21908,21912,21913,21925,21931,21935,21943,21957,21959,21967,21974,21984,21991,21992,21997,22003,22009,22026,22040,22049,22051,22053,22058,22066,22069,22085,22094,22098,22101,22105,22107,22112,22117,22121,22146,22150,22154,22160,22162,22163,22164,22169,22177,22181,22193,22196,22201,22210,22212,22214,22215,22220,22255,22263,22276,22280,22293,22298,22306,22317,22318,22323,22328,22330,22337,22342,22348,22351,22359,22365,22374,22380,22385,22397,22403,22415,22422,22431,22439,22442,22446,22452,22462,22467,22471,22473,22475,22480,22493,22502,22509,22514,22515,22521,22525,22529,22539,22549,22553,22558,22564,22573,22578,22595,22605,22607,22612,22623,22627,22630,22640,22656,22660,22672,22690,22693,22695,22704,22713,22719,22722,22748,22766,22767,22776,22780,22791,22793,22797,22801,22814,22818,22823,22826,22829,22835,22860,22875,22881,22905,22909,22917,22930,22941,22942,22952,22965,22974,22980,22985,22986,22996,23001,23009,23015,23027,23042,23048,23052,23054,23055,23056,23058,23121,23126,23135,23139,23143,23152,23153,23157,23160,23161,23168,23176,23180,23181,23189,23193,23205,23209,23214,23219,23234,23237,23247,23248,23251,2

mmikhan avatar Aug 04 '18 20:08 mmikhan

Please inform the customer of conversation # 412131 when this conversation has been closed.

mmikhan avatar Aug 04 '18 20:08 mmikhan

Please inform the customer of conversation # 413322 when this conversation has been closed.

devnihil avatar Aug 07 '18 17:08 devnihil

Please inform the customer of conversation # 418440 when this conversation has been closed.

amboutwe avatar Aug 23 '18 23:08 amboutwe

As nobody has looked on this bug for quite a while and it seems to be affecting our site, i've done a bit of digging.

The query SELECT object_id FROM ' . $storage->get_table_name() . ' WHERE incoming_link_count = 0 done by WPSEO_Premium_Orphaned_Post_Query::get_orphaned_object_ids() returns 330k records in our database, similar number to our wp_posts records.

I then run the following query

SELECT
	wp_posts.post_type,
	count(wp_posts.ID)
FROM
	wp_posts
WHERE
	wp_posts.ID in (
		SELECT object_id
		FROM wp_yoast_seo_meta
		WHERE incoming_link_count = 0
	)
GROUP BY wp_posts.post_type

which only returned a total of 900 results, meaning there are hundreds of thousands of records stored in wp_yoast_seo_meta and not actually used.

The majority of them appear to be WooCommerce orders, WooCommerce Subscriptions, past revisions, scheduled actions and overall unecessary records.

I think the issue starts from the fact the plugin is adding trash into wp_yoast_seo_meta or doesn't remove the unecessary code from there.

If our wp_yoast_seo_meta table was smaller, the queries done by WPSEO_Premium_Orphaned_Post_Query::get_orphaned_object_ids() and WPSEO_Premium_Orphaned_Post_Filter->get_post_total() would not be an issue.

Someone from the dev team should probably explain the following

  1. Why are there so many records in wp_yoast_seo_meta? Yoast should ignore any post types that do not require SEO
  2. Is it safe to remove all records from wp_yoast_seo_meta and keep just the ones that are Yoast-related?

@amboutwe please ping someone from the dev team to answer those questions so we can get this bug resolved promptly.

glagonikas avatar Aug 24 '18 09:08 glagonikas

Technical pointers

In working towards a solution, please consider using:

  • Upgrade routine to filter out irrelevant items
  • Pagination on the query
  • Making sure the is_post_type_accessible is considered in determining if it should end up in the table

moorscode avatar Aug 24 '18 11:08 moorscode