Jump to content
Sign in to follow this  

Медленные запросы на сайте по 7-8 сек

Recommended Posts

Добрый день, нужна помощь в решении медленных запросов .


Заметил 2ва медленных запроса по 7-8 сек на своем сайте:


SELECT DISTINCT pa.text, a.`attribute_id`, ad.`name`, at.`tooltip`, ag.attribute_group_id, agd.name AS attribute_group_name, agt.tooltip AS attribute_group_tooltip FROM `oc_product_attribute` pa LEFT JOIN oc_attribute a ON(pa.attribute_id=a.`attribute_id`) LEFT JOIN oc_attribute_description ad ON(a.attribute_id=ad.`attribute_id`) LEFT JOIN oc_attribute_group ag ON(ag.attribute_group_id=a.`attribute_group_id`) LEFT JOIN oc_attribute_tooltip at ON(a.attribute_id=at.`attribute_id` AND at.`language_id`='1') LEFT JOIN oc_attribute_group_tooltip agt ON(ag.attribute_group_id=agt.`attribute_group_id` AND agt.`language_id`='1') LEFT JOIN oc_attribute_group_description agd ON(agd.attribute_group_id=ag.`attribute_group_id`) LEFT JOIN oc_product p ON(p.product_id=pa.`product_id`) LEFT JOIN oc_product_to_category p2c ON(p.product_id=p2c.product_id) LEFT JOIN oc_category c ON (p2c.category_id=c.category_id) LEFT JOIN oc_product_to_store p2s ON(p.product_id=p2s.product_id) WHERE p.STATUS = '1' AND p.date_available <= NOW() AND p2s.store_id =0 AND (p2c.category_id = '632' OR c.parent_id = '632') AND pa.language_id = '1' AND ad.language_id = '1' AND agd.language_id = '1' ORDER BY ag.sort_order, agd.name, a.sort_order, ad.name, pa.text




SELECT COUNT(*) AS total, attribute_id, text FROM (SELECT DISTINCT p.product_id, p2a.attribute_id, p2a.text, COALESCE((SELECT price FROM oc_product_discount pd2 WHERE pd2.product_id = p.product_id AND pd2.customer_group_id = '1' AND pd2.quantity = '1' AND ((pd2.date_start = '0000-00-00' OR pd2.date_start < NOW()) AND (pd2.date_end = '0000-00-00' OR pd2.date_end > NOW())) ORDER BY pd2.priority ASC, pd2.price ASC LIMIT 1), (SELECT price FROM oc_product_special ps WHERE ps.product_id = p.product_id AND ps.customer_group_id = '1' AND ((ps.date_start = '0000-00-00' OR ps.date_start < NOW()) AND (ps.date_end = '0000-00-00' OR ps.date_end > NOW())) ORDER BY ps.priority ASC, ps.price ASC LIMIT 1), p.price) AS realprice FROM oc_product p LEFT JOIN oc_manufacturer m ON(m.manufacturer_id=p.manufacturer_id) LEFT JOIN oc_product_option_value pov ON (pov.product_id=p.product_id) LEFT JOIN oc_product_to_store p2s ON (p2s.product_id=p.product_id) LEFT JOIN oc_product_to_category p2c ON (p2c.product_id=p.product_id) LEFT JOIN oc_product_attribute p2a ON (p2a.product_id=p.product_id) LEFT JOIN oc_category c ON (p2c.category_id=c.category_id) WHERE 1 AND (p2c.category_id IN (74) OR c.parent_id IN (74)) AND p.price >=1 AND p.STATUS = '1' AND p.date_available <= NOW( ) AND p2a.language_id='1' AND p2s.store_id = 0) AS innertable WHERE 1 AND realprice >=1 GROUP BY attribute_id, text

Share this post

Link to post
Share on other sites

похожие запросы filterpro создает

вы попробуйте обновиться до версии 2.5, там атрибуты пошустрее выбираются из базы. если конечно у вас лицензионный фильтр

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.


Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.