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

[5.x] Use form submission query count instead of collection count #10534

Merged
merged 1 commit into from
Jul 31, 2024
Merged

[5.x] Use form submission query count instead of collection count #10534

merged 1 commit into from
Jul 31, 2024

Conversation

dnwjn
Copy link
Contributor

@dnwjn dnwjn commented Jul 31, 2024

Hello everyone!

We stumbled upon a bug on /admin/forms. We would get endless loading screens and eventually timeouts when visiting this page. We have quiet an amount of form submissions (~150.000), and the controller in the current setup retrieves all submissions, loads them in memory, to then return a count.

We're using Statamic 5 with the statamic/eloquent-driver implementation, and in that package it would retrieve the model for the submission, and then the model for the form. But it would do that for every submission. First we changed something there, but then realized a simple fix for this would be in the FormsController instead.

If you have any questions or comments about this, let me know!

@ryanmitchell
Copy link
Contributor

Nice. You'll need to update your PR title to [5.x] Use query count instead of collection count to pass the PR title check

@dnwjn dnwjn changed the title Use query count instead of collection count [5.x] Use query count instead of collection count Jul 31, 2024
@dnwjn
Copy link
Contributor Author

dnwjn commented Jul 31, 2024

Nice. You'll need to update your PR title to [5.x] Use query count instead of collection count to pass the PR title check

Gotcha, wasn't sure if it was something I had to do, or the team would do. It's changed!

@jasonvarga jasonvarga changed the title [5.x] Use query count instead of collection count [5.x] Use form submission query count instead of collection count Jul 31, 2024
@jasonvarga jasonvarga merged commit c7c3b73 into statamic:5.x Jul 31, 2024
17 of 18 checks passed
@dnwjn dnwjn deleted the patch-1 branch August 5, 2024 07:48
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

Successfully merging this pull request may close these issues.

3 participants