-
Notifications
You must be signed in to change notification settings - Fork 212
Description
I noticed a site really getting slowed with slow queries. After investigating, I noticed that on every page, post, product, a query of...
SELECT t., tt., tr.object_id
FROM agsterms AS t
INNER JOIN agsterm_taxonomy AS tt
ON t.term_id = tt.term_id
INNER JOIN agsterm_relationships AS tr
ON tr.term_taxonomy_id = tt.term_taxonomy_id
WHERE tt.taxonomy IN ('product_tag', 'wpsc_product_category', 'wpsc-variation')
AND tr.object_id IN (85830, ..., ..., ...) ORDER BY t.name ASC
...where the ids in tr.object_id IN (85830, ..., ..., ...) were all of the ids of every published wpsc_product.
So, essentially, for every single front end page load, every single product along with tax information is being queried and loaded for some reason, even if the page isn't displaying any products. (I though it was just this site, but it's happening on another site I have access to as well, but isn't causing any noticeable slow down, as there's only 40 products or so, with basically no variations.)