User tests: Successful: Unsuccessful:
Pull Request for Issue #9516 .
query clean (distinct instead of group by)
edit a module item from backend with debug plugin enabled and look for
apply the patch and edit a module
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Category | ⇒ | SQL |
Rel_Number | 0 | ⇒ | 9516 |
Relation Type | ⇒ | Pull Request for |
Thanks I will test in the morning with the large dataset
I have tested this item successfully on 77abb6d
Tested with 4000 menu items
Time: 8506.36 ms / 8620.83 ms Memory: 8.762 MB / 13.74 MB Application: afterRenderComponent com_modules
Time: 673.98 ms / 780.86 ms Memory: 8.760 MB / 13.75 MB Application: afterRenderComponent com_modules
Status | Pending | ⇒ | Ready to Commit |
Labels |
Added:
?
|
Milestone |
Added: |
it still slow but if i cancel the multilang query it work good in the template manager.
line 165:
if (JLanguageMultilang::isEnabled())
{
$query->select('l.title AS language_title, l.image AS language_image')
->join('LEFT', $db->quoteName('#__languages') . ' AS l ON l.lang_code = a.language');
}
is the lang query necessary?
i found another problem that in the module manager in menu assignment if i choose
Only on the pages selected / On all pages except those selected
the view of the menus are defective:
thanks in advance
About the broken tree display
Do you imply that this is related to this PR ?
so maybe posting this here is not relevant ?
Does it occur with the original SQL query (without changes of this pull request) ?
does it occur if you turn off language debug ?
does it occur when you removed the join clause with the language table ?
Do you imply that this is related to this PR ? - yes i did (i reported the bug)
Does it occur with the original SQL query (without changes of this pull request) ? - now i see that it occur even if i put the original file (the before PR file) so maybe it`s another bug
does it occur if you turn off language debug ? - yes
does it occur when you removed the join clause with the language table ? - yes
@benshaty
About the language join the data of it are need and used later:
why your SQL server cannot optimize this (we will need to look at explain)
@benshaty , @alikon , @brianteeman
please test the following:
Put it in comments (the language JOIN)
/*if (JLanguageMultilang::isEnabled())
{
$query->select('l.title AS language_title, l.image AS language_image')
->join('LEFT', $db->quoteName('#__languages') . ' AS l ON l.lang_code = a.language');
}*/
and replace it with an extra query on the languages table that
Find lines:
try
{
$links = $db->loadObjectList();
}
Replace them with:
try
{
$links = $db->loadObjectList();
if (JLanguageMultilang::isEnabled())
{
// 1. Find codes of needed languages
$lcodes = array();
foreach($links as $link) $lcodes[$link->language] = 1;
// 2. Query the languages table
$lcodes_escaped = array();
foreach($lcodes as $code => $i) $lcodes_escaped[] = $db->quote($code);
$query = $db->getQuery(true)
->select('title, image, lang_code')->from( $db->quoteName('#__languages') )
->where('lang_code IN ('.implode(',', $lcodes_escaped).')');
$db->setQuery($query);
$langs = count($lcodes) ? $db->loadObjectList('lang_code') : array();
// 3. Set needed language data into the menu links, (existing template code will work)
foreach($links as $link)
{
$lang = @ $langs[$link->language];
$link->language_title = $lang ? $lang->title : '';
$link->language_image = $lang ? $lang->image : '';
}
}
}
Instead of getting 2-10 rows from the languages table,
and how many rows are created before sorting and filtering occurs ?
Anyway the join with the language tables does so much unneeded data replication
so is not a core issue as you are using a non core template
@ggppdk didn`t work on module manager:
why would did it ever fix the broken display ? ))
did i say it would do anything about the broken display ?
Now about the delay on form save,
let me disagree , is your template code that execute the query 3 times
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-04-12 20:17:54 |
Closed_By | ⇒ | rdeutz |
Labels |
Removed:
?
|
Milestone |
Removed: |
Milestone |
Added: |
Milestone |
Added: |
Milestone |
Removed: |
I have tested this item successfully on 77abb6d
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9689.