Closed peet86 closed 1 year ago
So the plugin does add some extra queries, but they're to fetch the single entries themselves, for each site. That's largely unavoidable, and for me, changes 88 queries to 126 for x3 singles over 9 sites. It's at least unavoidable in the sense that's how element queries work and on your end, it's probably exacerbated by the number of custom fields. But we also only need to fetch these entries to get the site-specific cpEditUrl
.
Fixed for the next release. To get this early, run composer require verbb/expanded-singles:"dev-craft-4 as 2.0.1"
.
Awesome! I can confirm your change solves the issue. Thank you so much for this improvement.
I hope you don't mind that I "ported this back" to the craft-3 branch and created a pull request with the very same change.
I think this change may break the redirectToEntry
setting, as the site-urls value isn't a link to the entry anymore
Should be fixed in 2.0.3
Describe the bug
When the plugin is enabled the /admin/entries cp panel page takes couple of seconds to load. It is running 823 database queries which require 5000ms+ to finish VS. when the plugin disabled: 44 queries (16ms)
I've tried to debug the issue with Yii profiler. The main difference is that for some reason when the plugin is enabled the page is executing approx 800 times "elements"-related queries (see an example below). (VS 2-3 times when the plugin is disabled)
The queries are not slow (only a few ms per query) but after a few hundred of them MySQL pukes (hits some limits?) and one of the queries (not always the same one) takes 3000-4000 sec to execute. Then it continues..
Steps to reproduce
I'm not sure how you can reproduce this.. probably it's an edge case which happens only when the instance has lots of fields in singles.. This is a bigger site with 9 languages, 30+ sections, 300+ fields. Also matrix and neo fields are used heavily.
Craft CMS version
3.8 Pro
Plugin version
1.2
Multi-site?
Yes
Additional context
It happens both in dev and prod envs.