like my error that have been fiuxed ( #9516)
i have the same query error with the modules.
is it posibe to find the query and fix it with DISTINCT?
in the menus.php the fix that you sent me (line150~):
$query = $db->getQuery(true)
/->select('a.id AS value, cancel this line/
->select('DISTINCT(a.id) AS value, // add this line
a.title AS text,
a.alias,
a.level,
a.menutype,
a.type,
a.published,
a.template_style_id,
a.checked_out,
a.language,
a.lft')
->from('#__menu AS a')
->join('LEFT', $db->quoteName('#__menu') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt');
@benshaty
i am confused by the title of this thread,
(ok i think everybody understands that you mean performance)
Now which exactly view do you mean ?
That the query can not remove group by
There is another query that might be worth optmizing (may give some benefits in various views) and which can be optimized:
@alikon (i am only referencing you here, because your PRs are more respected than mine)
you may want to look into 1 more case
of unneeded GROUP-BY clause that can be replaced with DISTINCT:
in my site i have more then 3000~ menu items.
and more then 1000~ modules.
in march i had the same performance issue.
the SQL query that sort the menu items in "Menu Assignment" was fixed with this code:
->select('DISTINCT(a.id) AS value,
and then all the template and menus workd fast. (#9689)
now i have the same issue with the modules manager.
Labels |
Added:
?
|
Hi, news about this issue?
Think I got the same problem. 10000~ menu items per language, 1000~ modules per language. Why is that query on menu table running before showing modules overview in backend modules manager? What information is taken from menu table that isn't availible from modules table? Is it just for search tools / select page option?
Just to clarify: Error message is because i killed the query after a while at mysql workbench.
Ok will test #11627
I tried to figure out why the effects of this query are so extreme. I changed slightly this and that and found that the join to the language table is the cause of the performance drop.
The change from LEFT JOIN to a simple JOIN reduced the duration for about 10000 menu items from 70 seconds to 0.35 seconds! Ok, so far so good (I thought). The simple JOIN of course did not deliver the records which had an no corresponding language field in the menu table. I added the missing records by hand to language table, and the result is amazing: LEFT JOIN and simple JOIN deliver the identical result now, but the LEFT JOIN is still at the same slow speed!
I don't know what reason cause this behavior, but good to know.
so you have not tested #11627 yet ?
about
The change from LEFT JOIN to a simple JOIN reduced the duration for about 10000 menu items from 70 seconds to 0.35 seconds
if you (incorrectly) filter out many records (in some way) then of course you will less records to participate in the query and get performance improvement, that LEFT JOIN needs to be LEFT
please test #11627
Please test PR #11627
and also see comment (about which backend screens get a benefit):
#11627 (comment)
Also this PR for menu item edit form
#11628
can we close this sicne we have two PR?
Closed as requested
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-08-21 22:16:38 |
Closed_By | ⇒ | brianteeman |
@benshaty Please test #8863 perhaps that solves your issue.