? ? Pending

User tests: Successful: Unsuccessful:

avatar ggppdk
ggppdk
25 Aug 2017

Categoryedit field is quering the #__categories table, 2 times per category

  • because it has the query inside the loop that examines each category

Solution move query outside of the loop
[EDIT]
Better solution just remove the query completely, there is an other query to the categories table just above, we can use that one to retrieve each categories language

Testing Instructions

Open forms having categoryedit,
e.g. article form
the category selector appears as befoe

Expected result

a single query is done to categories table by categoryedit field,
to get the language of categories that appear in the category selector

Actual result

multiple queries are done: 1 query is done per category

  • and because when using fields the categoryedit is created twice

you get 2 queries per category
e.g. 500 categories you get 1000 queries
e.g. 5000 categories you get 10000 queries

Documentation Changes Required

none

avatar joomla-cms-bot joomla-cms-bot - change - 25 Aug 2017
Category Administration com_categories
avatar ggppdk ggppdk - open - 25 Aug 2017
avatar ggppdk ggppdk - change - 25 Aug 2017
Status New Pending
avatar ggppdk
ggppdk - comment - 25 Aug 2017

Ok why the title is like 1000 / 500 ?, it is not to be a smarta**, it is because it is better than saying "categoryedit does not scale", more people will notice and understand the need for this PR

so please excuse me for using the title ...

lately i am trying to use Joomla article form (which uses categoryedit field)
and my browser froze with 300 categories and debug on ... i had to stop what i was working on and track down this ...

avatar ggppdk ggppdk - change - 25 Aug 2017
Labels Added: ?
avatar ggppdk
ggppdk - comment - 26 Aug 2017

It is morning now, i was making coffee and realized there is another query to the categories table just above,
so we can just remove the query completely

avatar ggppdk ggppdk - change - 26 Aug 2017
The description was changed
avatar ggppdk ggppdk - edited - 26 Aug 2017
avatar alikon
alikon - comment - 26 Aug 2017

coffee always win

avatar alikon alikon - test_item - 26 Aug 2017 - Tested successfully
avatar alikon
alikon - comment - 26 Aug 2017

I have tested this item successfully on eadca7d


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17720.

avatar ggppdk ggppdk - change - 26 Aug 2017
Title
Perfomance issue, fix 10000 queries generated by categoryedit when you have 5000 categories (aka 2 queries per category)
Perfomance issue for forms with large number of categories, fix 1000 queries generated by categoryedit when you have 500 categories (aka 2 queries per category)
avatar ggppdk ggppdk - edited - 26 Aug 2017
avatar csthomas csthomas - test_item - 26 Aug 2017 - Tested successfully
avatar csthomas
csthomas - comment - 26 Aug 2017

I have tested this item successfully on eadca7d


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17720.

avatar franz-wohlkoenig franz-wohlkoenig - change - 27 Aug 2017
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 27 Aug 2017

RTC after two successful tests.

avatar ggppdk
ggppdk - comment - 27 Aug 2017

J3.8.0 milestone ?
it is easy to review the changes too

avatar mbabker mbabker - change - 27 Aug 2017
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-08-27 16:09:53
Closed_By mbabker
Labels Added: ?
avatar mbabker mbabker - close - 27 Aug 2017
avatar mbabker mbabker - merge - 27 Aug 2017

Add a Comment

Login with GitHub to post a comment