-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[6.0] Multiload of article associations #39189
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
base: 6.0-dev
Are you sure you want to change the base?
Conversation
I don't see it as a bug fix but as an improvement, so it should be made for the 4.3-dev branch and not the 4.2-dev branch. |
@richard67 Sorry, rebased. |
Thanks. |
This pull request has been automatically rebased to 5.0-dev. No new features will be merged into Joomla! 4.3 series. Joomla! 4.4 series is a bridge release to make migration from Joomla! 4 to 5 as smooth as possible. |
This does not work for me - perhaps I have misunderstood the instructions. I selected the testing data All Frontend Views / Content Component / Article Category List. The debug queries show there are 10 Select calls as shown above both with and without the patch applied (my list length). With the patch applied there are 50 queries in total, without the patch there are 49. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39189. |
@ceford Sorry, I've updated the test instructions for 5.0.0-bet2-dev, we need to enable display of associated articles. |
@Hackwar updated |
This pull request has been automatically rebased to 5.2-dev. |
@fgsw @Nuyonuyonoina Can you test this again? |
This pull request has been automatically rebased to 5.3-dev. |
I have tested this item ✅ successfully on ee1851d This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39189. |
This pull request has been automatically rebased to 6.0-dev. |
Summary of Changes
Load language associations for multiple articles and categories in a single query per each
ArticlesModel::getItems()
call.These methods now can accept array of IDs and return results grouped by ID in this case.
If a single
int
is provided as ID, the results are returned as they were before, full BC.CategoriesHelper::getAssociations()
CategoryAssociationHelper::getCategoryAssociations()
AssociationHelper::getAssociations()
Associations::getAssociations
Also,
CategoriesHelper::getAssociations()
is optimized and an extra query for each loaded category is removed by using$advClause
param ofAssociations::getAssociations()
.ArticlesModel::getItems()
now collects the article IDs to load the assocations for, next loads all associations in the single query.Similar to I have already done with tags load.
Testing Instructions
Actual result BEFORE applying this Pull Request
37 queries in total, see a separate SQL query for each displayed article, like:
Expected result AFTER applying this Pull Request
34 queries in total, see a single query per each
ArticlesModel::getItems()
call.A new single query is like:
Link to documentations
No documentation changes for docs.joomla.org needed
No documentation changes for manual.joomla.org needed