Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wc_customer_bought_product sql query is a Performance Nightmare #7322

Closed
30suns opened this issue Feb 6, 2015 · 1 comment
Closed

wc_customer_bought_product sql query is a Performance Nightmare #7322

30suns opened this issue Feb 6, 2015 · 1 comment
Labels
type: refactor The issue/PR is related to refactoring.

Comments

@30suns
Copy link

30suns commented Feb 6, 2015

The query in includes/wc-user-functions.php wc_customer_bought_product is a performance nightmare on the single product page when a reasonable number of orders exist. I've profiled it eating up 2-3 seconds in the database on a single product that has say, several hundred orders. I haven't investigated whether it can be optimized, or mysql indexes added to fix it, I've just added a custom line to return false; before the query runs, but it would be nice if it could be fixed properly in mainline.

@mikejolley mikejolley added type: refactor The issue/PR is related to refactoring. Needs Unit Tests labels Feb 8, 2015
@mikejolley mikejolley added this to the 2.4 (name undecided) milestone Feb 8, 2015
mikejolley added a commit that referenced this issue Mar 27, 2015
@mikejolley
Copy link
Member

Not much can be done tbh due to the joins required. I've done what I can to the query, and will have to add transient caching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: refactor The issue/PR is related to refactoring.
Projects
None yet
Development

No branches or pull requests

2 participants