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
I have noticed that the ->whereTaxonomy() method, adds a check against all entries from a given collection/taxonomy (not really sure), I've attached a screenshot in where you can see the query that is being run. This makes the query very big and takes a while to complete. Having multiple checks like this on a single page makes the load time increase significantly for obvious reasons.
I want to ask why this adds so much to the query and how there is a better method of doing this.
FYI: The big query is WITH the ->whereTaxonomy() method and the second (small query) is WITHOUT the ->whereTaxonomy() method.
How to reproduce
Make a collection
Make a taxonomy, in which you make some entries
Add a taxonomy select to the collection
Link a taxonomy to the collection
Try to retrieve only a specific set of entries from the collection using the whereTaxonomy method. (See snippet above)
Enable Laravel DEBUGBAR and see the big query (large if you have a lot of entries inside the collection).
On-going project, created from Statamic version 5.28.0, with the use of our custom Starter kit, upgraded in the meantime multiple times till the latest version, speaking as of now. Project has been on-going for 5-6 months. Now that the website is live, we noticed the extremely slow loading speeds, which made us investigate, stumbling upon this bug.
The text was updated successfully, but these errors were encountered:
Hey Duncan, sorry for the late response. Quite busy at work haha, I think I've actually tried that and didn't work, therefore using a default where clause now, which works and has a smaller query being generated.
Uh oh!
There was an error while loading. Please reload this page.
Bug description
Hi, another question regarding statamic performance.
I have a custom query scope, being used in the CP as well as in my templates
I have noticed that the
->whereTaxonomy()
method, adds a check against all entries from a given collection/taxonomy (not really sure), I've attached a screenshot in where you can see the query that is being run. This makes the query very big and takes a while to complete. Having multiple checks like this on a single page makes the load time increase significantly for obvious reasons.I want to ask why this adds so much to the query and how there is a better method of doing this.
FYI: The big query is WITH the
->whereTaxonomy()
method and the second (small query) is WITHOUT the->whereTaxonomy()
method.How to reproduce
Environment
Installation
On-going project, created from Statamic version 5.28.0, with the use of our custom Starter kit, upgraded in the meantime multiple times till the latest version, speaking as of now. Project has been on-going for 5-6 months. Now that the website is live, we noticed the extremely slow loading speeds, which made us investigate, stumbling upon this bug.
The text was updated successfully, but these errors were encountered: