{"action":"created","issue":{"url":"https://api.github.com/repos/Yoast/wordpress-seo/issues/8638","repository_url":"https://api.github.com/repos/Yoast/wordpress-seo","labels_url":"https://api.github.com/repos/Yoast/wordpress-seo/issues/8638/labels{/name}","comments_url":"https://api.github.com/repos/Yoast/wordpress-seo/issues/8638/comments","events_url":"https://api.github.com/repos/Yoast/wordpress-seo/issues/8638/events","html_url":"https://github.com/Yoast/wordpress-seo/issues/8638","id":287368618,"node_id":"MDU6SXNzdWUyODczNjg2MTg=","number":8638,"title":"WPSEO_Premium_Orphaned_Post_Filter->get_post_total slows down dashboard","user":{"login":"ziodave","id":11438,"node_id":"MDQ6VXNlcjExNDM4","avatar_url":"https://avatars3.githubusercontent.com/u/11438?v=4","gravatar_id":"","url":"https://api.github.com/users/ziodave","html_url":"https://github.com/ziodave","followers_url":"https://api.github.com/users/ziodave/followers","following_url":"https://api.github.com/users/ziodave/following{/other_user}","gists_url":"https://api.github.com/users/ziodave/gists{/gist_id}","starred_url":"https://api.github.com/users/ziodave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ziodave/subscriptions","organizations_url":"https://api.github.com/users/ziodave/orgs","repos_url":"https://api.github.com/users/ziodave/repos","events_url":"https://api.github.com/users/ziodave/events{/privacy}","received_events_url":"https://api.github.com/users/ziodave/received_events","type":"User","site_admin":false},"labels":[{"id":326269387,"node_id":"MDU6TGFiZWwzMjYyNjkzODc=","url":"https://api.github.com/repos/Yoast/wordpress-seo/labels/component:%20performance","name":"component: performance","color":"006b75","default":false},{"id":19494704,"node_id":"MDU6TGFiZWwxOTQ5NDcwNA==","url":"https://api.github.com/repos/Yoast/wordpress-seo/labels/enhancement","name":"enhancement","color":"bfe5bf","default":true},{"id":944589434,"node_id":"MDU6TGFiZWw5NDQ1ODk0MzQ=","url":"https://api.github.com/repos/Yoast/wordpress-seo/labels/next","name":"next","color":"df37e5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":20,"created_at":"2018-01-10T09:32:33Z","updated_at":"2018-09-01T15:14:18Z","closed_at":null,"author_association":"NONE","body":"<!-- Please use this template when creating an issue. \r\n- Please check the boxes after you've created your issue.\r\n- Please use the latest version of Yoast SEO.-->\r\n\r\n* [x] I've read and understood the [contribution guidelines](https://github.com/Yoast/wordpress-seo/blob/trunk/.github/CONTRIBUTING.md).\r\n* [x] I've searched for any related issues and avoided creating a duplicate issue.\r\n\r\n### Please give us a description of what happened.\r\n\r\nWordPress 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:\r\n\r\n```\r\nSELECT COUNT(ID)\r\nFROM wp_posts\r\nWHERE ID IN ( ...thousands of post ids... );\r\n```\r\n\r\nThe query may take up to one second to execute representing about 20% of the overall dashboard load time.\r\n\r\n### Please describe what you expected to happen and why.\r\n\r\nI expect faster load times.\r\n\r\n### How can we reproduce this behavior?\r\n1. Create thousands of posts (I have about 35.000)\r\n2. Open the dashboard\r\n3. Use Query Monitor to see the time it takes.\r\n\r\n### Technical info\r\n* WordPress version: 4.8.4\r\n* Yoast SEO version: 5.7.1\r\n* Relevant plugins in case of a bug: -\r\n"},"comment":{"url":"https://api.github.com/repos/Yoast/wordpress-seo/issues/comments/417866200","html_url":"https://github.com/Yoast/wordpress-seo/issues/8638#issuecomment-417866200","issue_url":"https://api.github.com/repos/Yoast/wordpress-seo/issues/8638","id":417866200,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzg2NjIwMA==","user":{"login":"iamazik","id":8946603,"node_id":"MDQ6VXNlcjg5NDY2MDM=","avatar_url":"https://avatars1.githubusercontent.com/u/8946603?v=4","gravatar_id":"","url":"https://api.github.com/users/iamazik","html_url":"https://github.com/iamazik","followers_url":"https://api.github.com/users/iamazik/followers","following_url":"https://api.github.com/users/iamazik/following{/other_user}","gists_url":"https://api.github.com/users/iamazik/gists{/gist_id}","starred_url":"https://api.github.com/users/iamazik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamazik/subscriptions","organizations_url":"https://api.github.com/users/iamazik/orgs","repos_url":"https://api.github.com/users/iamazik/repos","events_url":"https://api.github.com/users/iamazik/events{/privacy}","received_events_url":"https://api.github.com/users/iamazik/received_events","type":"User","site_admin":false},"created_at":"2018-09-01T15:14:18Z","updated_at":"2018-09-01T15:14:18Z","author_association":"MEMBER","body":"[Thu Aug 30 14:57:37.993230 2018] [:error] [pid 22585] [client 104.196.52.102:27566] KILLED QUERY (47764 characters long generated in `/nas/content/live/drnandi/wp-content/plugins/wordpress-seo-premium/premium/classes/premium-orphaned-post-query.php:37`):\r\n\r\n```sql\r\nSELECT COUNT( ID ) as total_orphaned, post_type\\n\\t\\t\\t\\t\\t\\tFROM wp_1313a2ns08_posts\\n\\t\\t\\t\\t\\t\\tWHERE\\n\\t\\t\\t\\t\\t\\t\\tID IN ( 5,8,14,17,20,22,26,29,33,36,38,40,377,380,402,409,1452,4183,4832,4836,4850,4854,4857,4863,4886,4889,4897,4904,4907,4917,4920,4923,4926,4929,4937,4945,4955,4988,5007,5028,5115,5129,5176,5270,5330,5348,5572,5664,5685,5708,5727,5742,5749,5763,5768,5843,5935,5953,5957,5979,6061,6065,6074,6077,6086,6166,6169,6184,6189,6229,6233,6236,6239,6242,6285,6288,6329,6341,6359,6419,6422,6499,6519,6527,6582,6649,6657,6660,6673,6722,6740,6753,6760,6774,6777,6799,6802,6827,6834,6841,6849,6877,6892,6901,6907,6926,6930,6936,6944,6987,6993,6997,7011,7016,7051,7056,7094,7108,7112,7116,7119,7122,7125,7152,7163,7166,7171,7187,7194,7201,7204,7207,7221,7229,7235,7254,7261,7270,7278,7287,7306,7310,7328,7331,7352,7370,7372,7378,7381,7393,7403,7408,7410,7429,7462,7464,7472,7517,7519,7546,7551,7558,7561,7582,7613,7619,7621,7627,7630,7643,7647,7651,7653,7669,7674,7680,7684,7687,7696,7706,7716,7721,7739,7757,7760,7771,7780,7791,7807,7826,7845,7875,7881,7905,7908,7914,7918,7942,7945,7962,7966,7969,7999,8010,8014,8028,8034,8037,8047,8049,8071,8095,8097,8130,8133,8142,8146,8189,8211,8215,8239,8246,8272,8274,8276,8278,8285,8290,8299,8301,8393,8406,8408,8414,8439,8453,8498,8621,8865,8925,13396,14006,14468,14833,16411,16413,16414,16415,16818,16975,17049,17090,17265,17268,17623,17675,17678,18297,18303,18315,18319,18327,18331,18346,18350,18355,18364,18367,18421,18486,18537,18540,18545,18549,18552,18556,18559,18563,18571,18574,18580,18582,18585,18589,18592,18671,18674,18731,18857,18861,18981,18984,19213,19220,19365,19456,19533,19587,19590,19669,19672,19766,19770,19772,19788,19800,19803,19850,19853,19881,19896,19957,20114,20118,20146,20217,20253,20256,20314,20393,20415,20420,20454,20554,20558,20603,20679,20696,20699,20737,20741,20744,20764,20791,20824,20837,20853,20870,20910,21021,21024,21033,21062,21076,21098,21104,21139,21152,21158,21189,21193,21197,21200,21202,21276,21374,21378,21387,21391,21402,21424,21429,21494,21499,21524,21532,21581,21603,21611,21614,21643,21652,21657,21666,21671,21693,21715,21718,21768,21786,21803,21829,21835,21840,21878,21886,21892,21915,21918,21944,21948,21970,21974,22021,22048,22056,22067,22089,22092,22100,22105,22123,22133,22149,22155,22162,22189,22194,22218,22225,22232,22251,22254,22291,22317,22355,22362,22385,22391,22399,22465,22472,22476,22483,22486,22532,22540,22570,22573,22576,22590,22597,22599,22628,22664,22674,22677,22683,22701,22743,22748,22760,22782,22795,22802,22805,22815,22836,22845,22891,22910,22919,22953,22977,22981,22993,23010,23019,23035,23043,23050,23053,23062,23069,23084,23100,23103,23110,23116,23123,23141,23187,23191,23203,23224,23273,23278,23297,23323,23366,23381,23395,23403,23407,23427,23454,23459,23506,23517,23548,23573,23590,23605,23614,23619,23623,23640,23671,23678,23703,23707,23730,23734,23737,23773,23777,23818,23828,23832,23927,23935,23959,23968,23971,24010,24073,24080,24083,24121,24138,24142,24167,24188,24198,24209,24214,24232,24246,24268,24271,24285,24302,24319,24325,24335,24350,24371,24383,24387,24390,24421,24443,24448,24471,24485,24597,24639,24643,24645,24671,24674,24693,24738,24740,24771,24917,24921,24926,24960,24963,24972,24975,24990,24995,25006,25032,25073,25094,25117,25236,25242,25245,25266,25279,25288,25295,25307,25315,25319,25351,25369,25382,25514,25517,25553,25564,25584,25642,25647,25657,25670,25671,25675,25701,25705,25717,25719,25722,25739,25754,25812,25819,25828,25830,25842,25844,25847,25851,25880,25889,25909,25947,25958,25962,25965,25990,25993,25997,26030,26151,26155,26159,26174,26178,26225,26250,26271,26281,26302,26332,26358,26372,26396,26401,26433,26437,26442,26484,26511,26538,26595,26598,26607,26613,26620,26632,26638,26653,26687,26689,26694,26701,26718,26722,26735,26758,26768,26783,26804,26830,26926,26928,26934,26948,26953,26973,27010,27043,27063,27100,27122,27131,27169,27173,27179,27256,27282,27285,27322,27327,27331,27353,27361,27365,27370,27372,27470,27474,27498,27550,27565,27606,27616,27626,27630,27637,27653,27681,27689,27698,27717,27720,27725,27731,27732,27770,27782,27789,27829,27837,27858,27936,27940,27947,27949,27951,27958,27988,28012,28016,28022,28037,28041,28044,28068,28107,28111,28114,28118,28162,28164,28166,28167,28169,28177,28182,28188,28191,28196,28199,28203,28211,28227,28285,28342,28343,28352,28355,28365,28372,28383,28413,28416,28418,28445,28448,28455,28463,28471,28527,28528,28571,28574,28599,28607,28631,28632,28641,28642,28657,28658,28723,28726,28743,28878,28879,28888,28894,28916,28967,28978,28979,28987,29002,29060,29076,29081,29106,29116,29119,29126,29127,29131,29147,29158,29159,29168,29217,29237,29243,29244,29267,29268,29269,29270,29271,29272,29273,29274,29276,29277,29278,29279,29280,29300,29309,29311,29325,29326,29329,29330,29333,29340,29353,29365,29405,29406,29416,29417,29464,29465,29475,29476,29480,29482,29488,29500,29501,29518,29522,29525,29532,29535,29540,29542,29550,29553,29558,29574,29588,29591,29595,29596,29602,29607,29608,29612,29622,29641,29646,29657,29669,29687,29688,29689,29691,29692,29693,29694,29695,29697,29698,29699,29700,29701,29702,29703,29704,29705,29706,29707,29708,29709,29711,29712,29714,29716,29717,29718,29720,29721,29722,29723,29724,29725,29727,29728,29729,29730,29731,29747,29749,29759,29771,29792,29938,30074,30087,30090,30120,30122,30173,30174,30188,30189,30190,30191,30192,30193,30194,30195,30196,30197,30199,30200,30201,30202,30203,30204,30205,30206,30207,30208,30209,30210,30211,30212,30213,30214,30215,30216,30217,30218,30219,30220,30221,30222,30223,30224,30225,30226,30227,30228,30229,30230,30231,30233,30294,30295,30335,30338,30359,30366,30375,30378,30385,30386,30482,30485,30533,30537,32050,32295,32296,32299,32305,32326,32327,32368,32409,32434,32448,32451,32454,32565,32566,32567,32568,32628,32645,32649,32656,32666,32694,32728,32732,32748,32763,32777,32790,32822,32862,32869,32873,32884,32915,32962,33049,33052,33057,33062,33063,33064,33072,33110,33143,33145,33146,33147,33157,33158,33160,33180,33181,33190,33194,33195,33196,33197,33198,33200,33201,33202,33203,33205,33208,33209,33210,33211,33212,33213,33214,33215,33216,33219,33222,33223,33224,33227,33260,33348,33349,33350,33361,33362,33363,33381,33382,33383,33392,33397,33399,33404,33405,33407,33409,33417,33419,33422,33423,33426,33429,33448,33457,33458,33498,33499,33501,33542,33691,33693,33719,33724,33735,33750,33820,33821,33843,33863,33865,33870,33871,33874,33882,33886,33888,33901,33931,33933,33934,33937,33945,33958,33959,33969,33983,33984,34002,34016,34017,34043,34045,34051,34053,34067,34069,34070,34075,34083,34084,34097,34108,34118,34124,34129,34131,34148,34153,34158,34165,34171,34172,34173,34174,34176,34179,34188,34189,34190,34191,34192,34205,34214,34237,34238,34248,34249,34283,34285,34301,34336,34340,34356,34358,34361,34364,34366,34374,34376,34382,34383,34400,34401,34403,34405,34413,34415,34417,34421,34426,34430,34459,34473,34479,34485,34504,34505,34522,34538,34539,34546,34548,34549,34555,34556,34557,34558,34585,34588,34613,34629,34632,34654,34737,34853,34857,34964,34972,34973,34975,35005,35006,35030,35061,35086,35087,35108,35138,35142,35164,35165,35649,35650,35688,35692,35694,35695,35701,35702,35703,35706,35720,35723,35742,35965,35966,36036,36038,36039,36048,36065,36253,36299,36309,36325,36334,36387,36390,36393,36430,36552,36558,36561,36633,36648,36651,36661,36671,36685,36692,36696,36716,36718,36725,36727,36775,36776,36778,36795,36799,36800,36812,36835,36837,36838,36840,36843,36846,36847,36860,36864,36887,36940,37168,37170,37173,37177,37192,37195,37198,37227,37228,37256,37259,37260,37285,37286,37287,37311,37316,37332,37333,37344,37348,37377,37383,37408,37411,37433,37568,37569,37570,37579,37580,37584,37589,37591,37593,37594,37595,37596,37597,37599,37600,37601,37602,37603,37608,37619,37623,37632,37662,37684,37697,37744,37757,37764,37770,37776,37802,37820,37821,37824,37825,37838,37841,37844,37845,37857,37888,37969,37977,37997,38003,38106,38136,38\r\n```"}}
{"actor":{"display_login":"iamazik"}}