Hi
We're experiencing slowness in invoice printing.
First we create invoice number, then we click on the PDF icon to see the document and it takes up to 40 seconds on a live busy site.
We checked out and MySQL was being very high on that time. Checking mysql-slow.log we found this query taking most of the waiting time:
SELECT i.*,
v.vendor_name AS company_name,
i.title AS title,
i.first_name AS first_name ,
i.middle_name AS middle_name,
i.last_name AS last_name,
i.phone_1 AS phone_1,
i.phone_2 AS phone_2,
vlang.vendor_phone AS phone_vendor,
i.fax AS fax,
u.email AS email,
i.address_1 AS address_1,
i.address_2 AS address_2,
i.city AS city,
s.state_name,
s.state_2_code,
s.state_3_code,
c.country_name,
c.country_2_code,
c.country_3_code,
i.zip AS zip,
vlang.vendor_store_name AS store_name,
vlang.vendor_store_desc AS store_desc,
vlang.vendor_url AS url,
IF (curr.currency_name IS NULL, CONCAT('Currency ',v.vendor_currency), curr.currency_name) AS currency_name,
IF (curr.currency_code_3 IS NULL, CONCAT('Currency ',v.vendor_currency), curr.currency_code_3) AS currency_3_code
FROM `j25_virtuemart_vendors` AS v
LEFT JOIN `j25_virtuemart_vmusers` AS vmusers ON v.virtuemart_vendor_id = vmusers.virtuemart_vendor_id
LEFT JOIN `j25_virtuemart_userinfos` AS i ON (vmusers.virtuemart_user_id=i.virtuemart_user_id AND i.address_type='BT')
LEFT JOIN `j25_virtuemart_countries` AS c ON (i.virtuemart_country_id = c.virtuemart_country_id)
LEFT JOIN `j25_virtuemart_states` AS s ON (i.virtuemart_state_id = s.virtuemart_state_id)
LEFT JOIN j25_virtuemart_vendors_it_it AS vlang ON vmusers.virtuemart_vendor_id = .vlang.virtuemart_vendor_id
LEFT JOIN `j25_users` AS u ON vmusers.virtuemart_user_id = u.id
LEFT JOIN `j25_virtuemart_currencies` AS curr ON v.vendor_currency = curr.virtuemart_currency_id
WHERE v.virtuemart_vendor_id=1 GROUP BY v.virtuemart_vendor_id LIMIT 1;
Is there any way to speed it up?
We're using VMInvoice 2.0.24.
Thanks