You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WC_Subscriptions_Order->render_contains_subscription_column_content() adds two additional queries for each order listed on the orders admin listing page.
A couple of ways to make an improvement:
The underlying code for wcs_order_contains_subscription() could be made more performant by avoiding the loading of any subscriptions (avoiding extra unneeded callbacks/filters), or at least avoiding the extra count query added on.
Consider priming the data needed for the ->render_contains_subscription_column_content() for all orders being rendered at once in a single query rather than one at a time.
The text was updated successfully, but these errors were encountered:
Thanks @prettyboymp for raising these performance issues.
I've just pushed up #732 which improves the performance of our render_contains_subscription_column_content() using the first method you suggested.
FWIW I ran these changes on a test store with ~5000 orders and saw a decent reduction in the number of queries ran while viewing 200 orders on the WooCommerce > Orders page (could be wrong but it looked to be around ~50% reduction).
Consider priming the data needed for the ->render_contains_subscription_column_content() for all orders being rendered at once in a single query rather than one at a time.
I'm interested to dig deeper into this idea but will need to explore it a bit more to see what we can do.
WC_Subscriptions_Order->render_contains_subscription_column_content()
adds two additional queries for each order listed on the orders admin listing page.A couple of ways to make an improvement:
wcs_order_contains_subscription()
could be made more performant by avoiding the loading of any subscriptions (avoiding extra unneeded callbacks/filters), or at least avoiding the extra count query added on.->render_contains_subscription_column_content()
for all orders being rendered at once in a single query rather than one at a time.The text was updated successfully, but these errors were encountered: