Skip to content

solidus_admin: Improve Products loading performance#6444

Open
sascha-karnatz wants to merge 3 commits intosolidusio:mainfrom
blish:solidus-admin-products-loading-performance
Open

solidus_admin: Improve Products loading performance#6444
sascha-karnatz wants to merge 3 commits intosolidusio:mainfrom
blish:solidus-admin-products-loading-performance

Conversation

@sascha-karnatz
Copy link
Copy Markdown
Contributor

Summary

This is a small set of improvements to increase the loading performance of the default product view. It is also removing a few N+1 queries.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.45%. Comparing base (852cb8e) to head (65b99bf).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6444      +/-   ##
==========================================
- Coverage   89.66%   89.45%   -0.22%     
==========================================
  Files         990      919      -71     
  Lines       20792    18980    -1812     
==========================================
- Hits        18644    16979    -1665     
+ Misses       2148     2001     -147     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Eager load variant images and prices to avoid N+1s and use .size instead of .count to avoid an extra query.
The name column has an index and it is the same default sorting as in solidus_backend. Remove distinct to reduce the response time even more. The view has no included left joins and it isn't necessary to filter duplicates.
This reduce the response time for database with 700000 products from 1 second to 67ms.
The distinct isn't necessary, because the result will be put into an IN filter and there is no reason to filter out possible duplicates. It slows only the query.
@sascha-karnatz sascha-karnatz force-pushed the solidus-admin-products-loading-performance branch from 7701c60 to 65b99bf Compare April 20, 2026 13:47
Copy link
Copy Markdown
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work 👏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants