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

Could Multi-DB be effecting Marketpress queries #3

Open
mrbm opened this issue Feb 4, 2016 · 0 comments
Open

Could Multi-DB be effecting Marketpress queries #3

mrbm opened this issue Feb 4, 2016 · 0 comments

Comments

@mrbm
Copy link

mrbm commented Feb 4, 2016

https://premium.wpmudev.org/forums/topic/bug-gigantic-amount-of-queries-in-marketpress-if-the-shopping-cart-is-empty

Just posted this, have done other research, but perhaps me seeing a problem with queries can help. Perhaps this high query count when things are not in the shopping cart are related to multi-db? Posted steps on replication:

Multisite
MarketPress WPMU Dev
Multi-DB plugin
https://wordpress.org/plugins/query-monitor/

Set up a category, in that category place 9 products. Each product should have the variations 3 sizes and 3 colors each with their own image. That's 9 variations in all per product. Pretty normal.

now visit the site with 0 items in the shopping cart.

There will be roughly 1200 queries and SUPER slow load.

Now add 1 item to the shopping cart and visit that same category. The query count has now dropped to roughly 320 queries with reasonable load times (it doesn't seem to be doing any image resizing in the background possibly)

Is this related to Multi-DB or are you seeing this same scenario play out on you multi-site set up.

On that category page, WITHOUT anything in the shopping cart, there are 473 queries made to:

SELECT SQL_CALC_FOUND_ROWS wp_4_posts.ID
FROM wp_4_posts
WHERE 1=1
AND wp_4_posts.ID NOT IN  (A CHANGING POST ID IN MULTIPLES OF 30)
AND wp_4_posts.post_type = 'product'
AND (wp_4_posts.post_status = 'publish'
OR wp_4_posts.post_status = 'private')
ORDER BY wp_4_posts.post_date DESC
LIMIT 0, 3

However when there is 1 item in the shopping cart, this type of query is only made 95 times.

IN addition this query is always followed by this query:
SELECT FOUND_ROWS()
Further adding to the query count..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant