[Vtigercrm-developers] default sort orders
Alan Bell
alan.bell at libertus.co.uk
Wed Sep 24 12:57:27 GMT 2014
it would appear that the value LISTVIEW_DEFAULT_SORTING in
performance.inc.php doesn't do much at the moment, it should set default
list view sorting to be something sensible for each entity module.
Whatever it is set to at the moment things sort by default on modified
time DESC, which in some cases is a rather bad thing to do and can cause
slow queries. I think to fix it the file
modules/Vtiger/models/ListView.php around line 188 should be:
if(empty($orderBy) && empty($sortOrder) && $moduleName
!= "Users"){
if(PerformancePrefs::getBoolean('LISTVIEW_DEFAULT_SORTING', true)) {
$orderBy = $moduleFocus->default_order_by;
$sortOrder =
$moduleFocus->default_sort_order;
}
}
so that if a sort order isn't specified in the request it should use the
default sort order for the module rather than modifiedtime desc, and no
particular order if default sorting is turned off. No particular order
is faster than sorting by modified time, especially on contacts it would
seem.
Alan.
--
Libertus Solutions
http://libertus.co.uk
More information about the vtigercrm-developers
mailing list