PR-4.4-dev Pending

User tests: Successful: Unsuccessful:

avatar Denitz
Denitz
1 Apr 2023

Summary of Changes

Currently, each category URL produces a separate SQL query to load a category.
We can significantly speed-up this by preloading all categories.

Testing Instructions

Create Articles Categories module with lots of categories

Actual result BEFORE applying this Pull Request

See lots of SQL queries to #__categories table.

Expected result AFTER applying this Pull Request

See much less queries.

Link to documentations

No documentation changes for docs.joomla.org needed
No documentation changes for manual.joomla.org needed

avatar joomla-cms-bot joomla-cms-bot - change - 1 Apr 2023
Category Front End com_content Libraries
avatar Denitz Denitz - open - 1 Apr 2023
avatar Denitz Denitz - change - 1 Apr 2023
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 1 Apr 2023
Category Front End com_content Libraries SQL Administration com_admin Postgresql com_redirect JavaScript Repository NPM Change Front End com_content Installation Libraries
avatar Denitz Denitz - change - 1 Apr 2023
Labels Added: PR-4.3-dev
2bdbe0e 1 Apr 2023 avatar fix
avatar joomla-cms-bot joomla-cms-bot - change - 1 Apr 2023
Category Front End com_content Libraries SQL Administration com_admin Postgresql com_redirect JavaScript Repository NPM Change Installation Front End com_content Libraries
avatar Denitz Denitz - change - 1 Apr 2023
Labels Added: NPM Resource Changed PR-4.4-dev
3f48695 1 Apr 2023 avatar fix
avatar Denitz Denitz - change - 1 Apr 2023
Labels Removed: NPM Resource Changed
avatar laoneo
laoneo - comment - 4 Apr 2023

Instead of adding a new variable, can you not just call get without id in the router and then lookup for the one with the id you are looking for?

avatar Hackwar
Hackwar - comment - 4 Apr 2023

I'm very much against this. I would have to look if someone broke it in the last few years, but the original code was written to specifically NOT load the whole category tree for performance reasons and especially for big sites, loading all categories could become an issue. Before we could merge something like this, I would first like to see some numbers for the effect this would have, especially on sites with thousands of categories. If this is fine with, say, 5k categories, then we could talk about this again.

avatar Denitz Denitz - change - 4 Apr 2023
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2023-04-04 11:03:09
Closed_By Denitz
Labels Removed: PR-4.3-dev
avatar Denitz Denitz - close - 4 Apr 2023
avatar brianteeman
brianteeman - comment - 5 Apr 2023

There is definitely a problem here and its not just impacting com_content. Every component that uses com_categories is impacted. Crazy that I end up with multiple queries to com_categories for components that are not even on the page.

Add a Comment

Login with GitHub to post a comment