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

Duplicate query issue with large data #15

Closed
parthi-me opened this issue Jan 11, 2022 · 6 comments
Closed

Duplicate query issue with large data #15

parthi-me opened this issue Jan 11, 2022 · 6 comments

Comments

@parthi-me
Copy link

Hi,

We have a craft cms site, with nearly 300 sections, each section has only one entry type with 5 or 6 conditional fields. We see a huge delay when switching over control panel menu pages. This occurs on all menus even when switching between settings, utilities etc,

Our initial findings are showing there are a lot of duplicate queries initiated by reasons plugin is the cause for this delay.
For example, when we load the utilities page, after disabling the plugin only 60 odd queries were running, After enabling we see nearly 12000 queries were running. See attached,
craft-with-reasons
Craft-without-reasons

Could we load the queries only on the pages needed?

System info:
PHP version 7.4.24
OS version Linux 5.4.0-91-generic
Database driver & version MySQL 5.7.35
Image driver & version GD 7.4.24
Craft edition & version Craft Pro 3.7.28
Yii version 2.0.44
Twig version v2.14.10
Guzzle version 7.4.1

Reason plugin version - 2.2.5

@mmikkel
Copy link
Owner

mmikkel commented Jan 11, 2022

nearly 300 sections

Whoa 🤯

@parthi-me Reasons caches all data in production (i.e. when devMode is false), so I assume you're primarily running into this issue in development environments?

@parthi-me
Copy link
Author

Yes @mmikkel Above mentioned site is in development mode.

@mmikkel
Copy link
Owner

mmikkel commented Jan 11, 2022

@parthi-me I've implemented a fix – if you'd be able to help me test it, that'd be great:

Change your mmikkel/reasons dependency in composer.json to

dev-master#bab707bab9a58bb1b385939a9ae1c95f7986a13e as 2.2.5

Then run composer update mmikkel/reasons.

Thanks!

@parthi-me
Copy link
Author

Thank you @mmikkel, Above fix is working fine in the initial testing. Attached is the same utilities page, which is loading only 67queries, reduced from 12000 queries previously.
Screenshot 2022-01-11 203736

@mmikkel
Copy link
Owner

mmikkel commented Jan 11, 2022

@parthi-me Thank you for the follow-up! That’s quite an improvement…

I’ll get a release out with that fix ASAP.

@mmikkel
Copy link
Owner

mmikkel commented Jan 13, 2022

@parthi-me Just tagged release 2.2.6 with that fix. Thanks for reporting!

@mmikkel mmikkel closed this as completed Jan 13, 2022
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

2 participants