Jump to content

Slow query log


MichaelEZ

Recommended Posts

Hello, so we are facing this issue - when i joined company i coud see those slow query log in admin panel (about 580 but was running till today) site was fully loaded in about 2-7 sec. This week we reached full space so we did upgrade and transfer whole site to new server in one go.. everything was OK but today after lunch time site stoped working. So they put us into quarantine and query log is raising up to sky... right now it is 5482 logs.. Im not looking for instant solution but coud use any advice. I even ask for their opiniom but they dont care at all, even when offering money.. 

If u wonder why i did not ask dev - he is on vacation till next week :/ Every hour we are loosing great amount of money. 

 

For example this one is in log 210 times

# Time: 190808 19:35:32
# User@Host: naradiesk_beta[naradiesk_beta] @  [10.10.156.76]
# Thread_id: 70498566  Schema: naradiesk_beta  QC_hit: No
# Query_time: 15.535647  Lock_time: 0.001151  Rows_sent: 10  Rows_examined: 1309330
# Rows_affected: 0
use naradiesk_beta;
SET timestamp=1565285732;
SELECT DISTINCT p.id_product id_product,p.reference preference,im.id_image image, pl.name pname, cl.name cname,
						cl.link_rewrite crewrite, pl.link_rewrite prewrite ,(
				SELECT SUM(weight)
				FROM ps_search_word sw
				LEFT JOIN ps_search_index si ON sw.id_word = si.id_word
				WHERE sw.id_lang = 6
					AND sw.id_shop = 1
					AND si.id_product = p.id_product
					AND (sw.word LIKE '%komp%')
			) position
					FROM ps_product p
					INNER JOIN `ps_product_lang` pl ON (
						p.`id_product` = pl.`id_product`
						AND pl.`id_lang` = 6 AND pl.id_shop = 1 
					)
					 INNER JOIN ps_product_shop product_shop
		ON (product_shop.id_product = p.id_product AND product_shop.id_shop = 1)
					INNER JOIN `ps_category_lang` cl ON (
						product_shop.`id_category_default` = cl.`id_category`
						AND cl.`id_lang` = 6 AND cl.id_shop = 1 
					)
                                              LEFT JOIN `ps_image` im ON  (p.`id_product` = im.`id_product`AND `cover` = 1)
					WHERE p.`id_product`  IN (40,71,72,74,97,102,148,157,167,168,212,229,236,237,238,239,240,317,322,352,353,354,355,357,407,431,497,499,516,528,547,591,621,641,682,688,705,933,943,968,969,970,971,972,975,1062,1068,1086,1087,1088,1089,1157,1158,1675,1693,1699,1714,1752,1756,1855,1883,1899,1974,1975,2000,2001,2037,2038,2042,2064,2065,2066,2067,2073,2074,2090,2095,2096,2097,2110,2231,2240,2241,2243,2298,2316,2324,2343,2346,2374,2378,2388,2416,2440,2441,2492,2493,2494,2495,2549,2560,2647,2648,2943,2979,3049,3050,3063,3301,3307,3309,3310,3340,3441,3446,3462,3463,3508,3529,3531,3554,3556,3566,3584,3587,3613,3622,3624,3628,3630,3641,3644,3659,3676,3685,3696,3702,3764,3765,3780,3790,3792,3808,3809,3815,3826,3828,3830,3831,3832,3833,3834,3835,3840,3841,3842,3843,3844,3845,3846,3847,3848,3849,3850,3856,3860,3874,3881,3882,3883,3884,3885,3886,3888,3890,3891,3918,3923,3937,3939,3957,3958,3964,3967,3973,3980,3985,3998,4004,4005,4007,4009,4010,4013,4014,4017,4018,4019,4021,4025,4028,4053,4060,4061,4063,4066,4069,4081,4084,4098,4099,4103,4105,4114,4116,4118,4132,4159,4161,4162,4163,4165,4326,4327,4337,4340,4341,4350,4363,4364,4365,4366,4368,4369,4370,4371,4372,4389,4395,4397,4398,4400,4412,4414,4448,4449,4452,4453,4454,4477,4529,4561,4564,4565,4566,4581,4597,4613,4631,4645,4646,4653,4661,4664,4665,4666,4682,4692,4697,4776,4809,4814,4821,4838,4839,4858,4900,4902,4910,4914,4917,4919,4924,4925,4946,4952,4953,4954,4970,5006,5010,5012,5023,5024,5025,5026,5030,5036,5040,5066,5067,5068,5069,5070,5071,5072,5073,5074,5077,5078,5079,5080,5081,5082,5083,5084,5085,5086,5087,5088,5089,5090,5091,5092,5093,5094,5095,5096,5097,5098,5099,5100,5101,5102,5103,5104,5105,5107,5108,5109,5110,5111,5112,5113,5114,5158,5178,5674,5803,5882,5918,6030,6035,6038,6052,6053,6054,6056,6057,6059,6061,6062,6063,6064,6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6076,6077,6078,6079,6080,6081,6082,6083,6084,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096,6097,6099,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6181,6399,6402,6405,6406,6407,6429,6448,6470,6475,6478,6482,6483,6484,6488,6528,6556,6562,6599,6656,6657,6701,6767,6768,6769,6770,6771,6781,6784,6785,6786,6798,6799,6800,6801,6802,6808,6873,6874,6875,6876,6877,6884,6890,6893,6894,6895,6906,6907,6908,6923,6926,6941,6953,6954,6955,6956,6957,6958,6963,6968,6970,6971,6972,6978,6984,6988,6996,6998,6999,7004,7008,7011,7012,7021,7033,7034,7062,7063,7071,7101,7107,7109,7110,7119,7146,7171,7196,7276,7278,7279,7281,7297,7298,7303,7319,7389,7393,7394,7395,7431,7443,7444,7446,7452,7464,7465,7552,7557,7558,7559,7560,7562,7576,7577,7578,7579,7686,7693,7705,7726,7728,7729,7762,7839,7939,8015,8039,8048,8056,8060,8067,8068,8071,8072,8073,8078,8079,8080,8168,8169,8311,8327,8428,8430,8445,8446,8450,8451,8453,8457,8464,8465,8468,8471,8497,8500,8501,8502,8503,8504,8519,8520,8523,8526,8527,8530,8531,8535,8541,8546,8548,8558,8559,8632,8636,8637,8685,8686,12169,12173,12174,12175,12176,12178,12179,12184,12187,12188,12191,12192,12196,12197,12790,13837,14051,14122,14188,14189,14190,14203,14204,14212,14223,14224,14250,14252,14253,14264,14280,14300,14304,14325,14449,14450,14451,14452,14453,14454,14455,14456,14457,14459,14460,14461,14462,14463,14464,14465,14466,14467,14468,14469,14470,14471,14472,14477,14478,14479,14480,14481,14482,14483,14484,14485,14486,14487,14488,14489,14490,14491,14492,14493,14494,14495,14496,14497,14498,14499,14500,14501,14502,14503,14504,14505,14506,14507,14508,14509,14510,14511,14512,14513,14514,14515,14516,14517,14518,14519,14520,14521,14522,14523,14524,14525,14526,14527,14528,14529,14530,14531,14532,14533,14534,14535,14537,14538,14539,14540,14541,14542,14543,14544,14545,14546,14547,14548,14549,14550,14551,14552,14553,14554,14555,14556,14557,14558,14559,14560,14606,14612,14645,14646,14795,14880,14891,14904,14913,14955,14977,15049,15085,15135,25105,25153,25180,25181,25183,25185,25196,25204,25209,25220,25221,25222,25232,25281,25365,25380,25387,25431,25453,25460,25462,25463,25480,25485,25509,25510,25511,25514,25518,25520,25525,25527,25531,25549,25593,25623,25672,25687,25767,25810,25813,25815,25816,25817,25819,25820,25827,25829,25831,25833,25836,25840,25841,25842,25846,25847,25861,25898,25900,25907,25914,25920,25958,25959,25960,25961,25964,26011,26012,26165,26582,26583,26584,26585,26586,26587,26588,26589,26590,26591,26592,26593,26594,26595,26596,26597,26598,26599,26600,26601,26602,26603,26604,26605,26670,26671,26672,26717,26747,26767,26768,26769,26770,26774,26775,26776,26787,26788,26789,26790,26820,26825,26872,27464,27497,27525,27526,27533,27534,27564,27569,27570,27583,27584,27586,27588,27589,27592,27604,27613,27630,27636,27638,27661,27669,27680,27681,27687,27787,27856,28037,28042,28130,28132,28137,28138,28141,28142,28143,28156,28158,28166,28168,28170,28171,28173,28280,28288,28289,28396,28424,28504,28578,28581,28659,28660,28665,28666,28671,28672,28673,28677,28679,28680,28681,28682,28686,28782,28783,28824,28825,28831,28839,28840,28841,28842,28844,28853,28855,28857,28954,28998,29004,29022,29060,29062,29064,29070,29072,29075,29102,29104,29113,29116,29126,29127,29135,29145,29162,29182,29185,29186,29206,29207,29211,29212,29234,29246,29247,29249,29250,29251,29252,29253,29254,29255,29268,29276,29289,29295,29296,29297,29298,29302,29304,29306,29309,29317,29318,29326,29328,29332,29333,29344,29352,29353,29355,29356,29357,29359,29360,29361,29364,29365,29366,29369,29370,29371,29376,29385,29387,29391,29393,29394,29395,29396,29397,29406,29407,29409,29412,29413,29414,29426,29438,29448,29506,29519,29520,29524,29534,29542,29548,29568,29569,29570,29571,29572,29573,29574,29575,29576,29579,29582,29584,29612,29613,29620,29632,29634,29637,29677,29678,29680,29683,29855,29856,29861,29866,29867,29872,29893,29952,29960,29961,29963,29966,29979,29999,30000,30004,30056,30058,30062,30063,30064,30066,30073,30088,30106,30107,30108,30109,30111,30112,30116,30117,30118,30119,30120,30122,30124,30128,30149,30151,30152,30160,30165,30183,30184,30210,30214,30218,30219,30220,30222,30231,30232,30284,30285,30297,30339,30340,30358,30378,30533,30539,30546,30547,30558,30595,30617,30659,30860,30895,30951,30953,30958,30959,30964,30965,30982,30983,30984,30985,31012,31013,31099,31100,31148,31159,31191,31200,31219,31244,31347,31348,31352,31353,31354,31369,31370,31382,31385,31386,31388,31389,31390,31391,31392,31394,31395,31396,31398,31552,31553,31644,31647,31732,31733,31734,31735,31767,31883,31885,31919,31920,31944,31985,32006,32044,32045,32048,32051,32052,32087,32088,32089,32090,32091,32098,32107,32137,32148,32149,32150,32158,32247,32250,32267,32274,32278,32279,32280,32287,32291,32292,32384,32387,32459,32463,32479,32482,32484,32485,32486,32516,32517,32526,32528,32530,32532,32535,32552,32553,32554,32575,32577,32579,32594,32595,32596,32599,32600,32601,32603,32608,32612,32614,32616,32684,32687,32690,32697,32698,32709,32743,32773,32793,32801,32805,32811,32815,32847,32849,32869,32871,32873,32994,32995,32996,32997,33053,33149,33150,33218,33240,33500,33501,33502,33513,33532,33540,33562,33563,33671,33684,33687,33692,33712,33843,33846,33847,33848,33849,33853,33878,33930,34038,34039,34146,34197,34198,34267,34375,34408,34412,34413,34425,34448,34455,34457,34458,34459,34462,34473,34474,34475,34476,34477,34483,34487,34540,34616,34617,34623,34624,34630,34640,34641,34642,34646,34654,34660,34661,34662,34665,34666,34667,34668,34670,34671,34674,34675,34684,34687,34688,34689,34690,34691,34693,34711,34740,34742,34756,34772,34818,34836,34965,34966,34977,34978,34981,34982,34983,34985,34987,34989,34992,34995,34997,34998,34999,35001,35004,35008,35009,35010,35045,35046,35047,35058,35060,35061,35062,35065,35066,35067,35068,35069,35070,35073,35074,35075,35076,35077,35081,35082,35084,35085,35087,35088,35115,35118,35119,35120,35121,35122,35123,35124,35128,35129,35266,35267,35270,35271,35274,35355,35409,35410,35411,35412,35413,35441,35449,35451,35460,35504,35505,35516,35517,35519,35520,35521,35523,35525,35536,35538,35539,35542,35543,35545,35547,35548,35550,35552,35560,35588,35648,35808,35874,35913,35924,35966,35967,35970,35971,35972,35973,36095,36096,36097,36098,36101,36129,36130,36131,36132,36133,36134,36135,36138,36141,36147,36149,36158,36160,36164,36171,36315,36347,36415,36416,36417,36440,36441,36461,36468,36472,36474,36476,36479,36628,36630,36639,36641,36643,36648,36764,36852,36853,36854,36855,36874,36877,36879,36886,36887,36888,36889,36890,36891,36894,36899,36922,36928,36934,36935,36936,36937,36938,36939,36940,36941,36943,36946,36947,36948,36949,36950,36951,36952,36953,36991,36997,37001,37002,37004,37045,37046,37047,37048,37051,37052,37093,37096,37101,37102,37139,37141,37211,37227,37231,37240,37241,37265,37269,37287) 
					ORDER BY position DESC LIMIT 10;

Ty for idea/reply!   

Michael V.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...