Closed maxi032 closed 11 months ago
Thanks for reporting. The n+1 problem should be resolved by: https://github.com/statamic/eloquent-driver/commit/59a45e33484e74a24379bb2f01496bc99db0de78
I hope to get some time this week to look into the query not scoping to the site and figure out a fix for that.
Can you let me know the tag you are using or control panel page you are seeing the
select * from `entries` where `collection` = 'products' and (json_extract(`data`, '$."product_categories"') is not null AND json_type(json_extract(`data`, '$."product_categories"')) != 'NULL')
query on? Any combinations I try result in the site being added, so I'm struggling to recreate what you are seeing.
@maxi032 any update? I’m unable to recreate currently
@ryanmitchell Thanks for the reply. I'll let you know soon. Sorry I haven't seen your answer
@ryanmitchell Here
is the CP page of the Products collection:
And heree is the taxonomy term 'product_category':
Product categories have a parent:
Edit page of the parent field:
Im still unsure where you are seeing the querying of all the entries - ideally you would supply a sample repository showing the issue and clear directions as to how to recreate the issue. This would allow be to investigate fully without any guesswork.
Closing due to inactivity. Feel free to re-open if you are providing the information requested or a sample repository with details of where to see the issue.
I have a multisite with a Products collection that has a taxonomy product_categories applyed to it. Blueprints are stored statically but collections and taxonomies are in db. I think that the driver is loading all entries from all sites that have that specific product category. What is causing this query? Just the fact that I assigned a taxonomy to a collection? Instead what I would expect is that when I am o products/nl only the entries of site nl would be queried+origin. I also see that there is an n+1 problem that seems to be caused by the driver: I would have expected select * from products where id in (23676, 23681, 32787, only ids of nl) instead I get:
I am using statamic v3 pro with Laravel9 What am I doing wrong?