plamensl Posted September 19, 2012 Share Posted September 19, 2012 I receive queries which lock the database and i have no idea why. No load on the server. Database is small ~ 8 000 items Here is the query : # Time: 120919 14:31:38 # User@Host: premiumpharma[premiumpharma] @ localhost [127.0.0.1] # Query_time: 1057.872841 Lock_time: 0.004413 Rows_sent: 0 Rows_examined: 8858281 SET timestamp=1348054298; SELECT DISTINCT p.id_product, 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 si.id_product = p.id_product AND (sw.word LIKE '%') ) position FROM ps_product p INNER JOIN `ps_product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = 6) INNER JOIN `ps_category_lang` cl ON (p.`id_category_default` = cl.`id_category` AND cl.`id_lang` = 6) WHERE p.`id_product` IN (27309,27325 ... Rows_examined is enormous : 8858281 sw.word LIKE '%' ? Ha anyone experienced this ? Link to comment Share on other sites More sharing options...
triaffath Posted September 19, 2012 Share Posted September 19, 2012 may be server temporary files is full, need to clean up temporary files server Link to comment Share on other sites More sharing options...
El Patron Posted September 19, 2012 Share Posted September 19, 2012 what version of ps? Link to comment Share on other sites More sharing options...
plamensl Posted September 20, 2012 Author Share Posted September 20, 2012 Version is 1.4.9.0 Link to comment Share on other sites More sharing options...
El Patron Posted September 20, 2012 Share Posted September 20, 2012 the call is from classes/Search.php here is a link to forge items that are similar to what you described. To many for me to read for now and hope it helps. http://forge.prestashop.com/secure/IssueNavigator.jspa? Link to comment Share on other sites More sharing options...
plamensl Posted September 20, 2012 Author Share Posted September 20, 2012 I found the same report here http://forge.prestashop.com/browse/PSCFI-4556 No solution though. I think this part of the query is the problem - should wildcard empty searches like 'sw.word LIKE '%' be allowed ? There should be 3 symbols minimum, according to configuration. 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 si.id_product = p.id_product AND (sw.word LIKE '%') Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now