Sylius: N+1 issue, thousands of DB querys on the taxons and products admin pages

Created on 26 Feb 2020  Â·  6Comments  Â·  Source: Sylius/Sylius

Sylius version affected: 1.6.4

Description
The taxon tree on the taxon and products admin page is querying for each taxon individually and then querying for each translation individually, the result is an enormous amount of DB queries being used instead of two. A site with 5000 categories with a single translation each results in 11.9k db queries per page load.

Screenshot 2020-02-26 at 09 33 44
Screenshot 2020-02-26 at 09 28 36

Steps to reproduce
have a large number of product categories and visit the admin panel taxon or product section.

Possible Solution
Eager Load the Taxons and their translations for these pages.

Performance Potential Bug

Most helpful comment

the same issue is present in the frontend too.

Screenshot 2020-03-04 at 16 35 30

All 6 comments

the same issue is present in the frontend too.

Screenshot 2020-03-04 at 16 35 30

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

Any progress on this issue?

I suggest that translations should be eagerly loaded. This problem is also present with the translations of the attributes. In our shop we have 60 attributes and 4 locales and loading a product produces 1020 queries when loading a product to edit it.

image

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

This is still an issue in 1.8.

Was this page helpful?
0 / 5 - 0 ratings