[Vtigercrm-developers] ORDER BY modifiedtime slow...

nilay khatri nilay.spartan at gmail.com
Thu Jul 5 12:52:12 GMT 2018


I would rather create a custom calculated field like "Last modified (in
days)" and do ordering on that. That should be faster as compared to
sorting on a date time field.

On Thu, Jul 5, 2018 at 6:20 PM nilay khatri <nilay.spartan at gmail.com> wrote:

> That's true.
>
> Yeh you will have to comment out those lines of code.
>
> We did some research with a DBA on improving this and various other parts
> but there was no productive outcome.
>
> On Thu, Jul 5, 2018 at 6:18 PM Alan Lord <alanslists at gmail.com> wrote:
>
>> On 05/07/18 13:39, nilay khatri wrote:
>> > Can I remove the "ORDER BY vtiger_crmentity.modifiedtime DESC" clause
>> > globally on vtiger 7.1?
>> >
>> > What other field would you then sort on ?
>>
>> As with earlier versions of vtiger it didn't bother - MySQL would sort
>> how it sees fit.
>>
>> Ordering by crmid would, I expect be much faster as it is an integer,
>> but a particular ordering is not critical IMHO for loading Listviews;
>> not when compared to waiting 5 seconds for a page of 20 records to load
>> ;-)
>>
>> PS: /modules/Vtiger/Models/ListView.php - line 248*
>>
>> Al
>>
>> > alanlord at dev:/var/www/html/vt71/modules⟫ grep -rn "ORDER BY
>> vtiger_crmentity.modifiedtime DESC" *
>>
>> > Documents/models/ListView.php:221:                      $listQuery .= '
>> ORDER BY vtiger_crmentity.modifiedtime DESC';
>> > Import/models/ListView.php:91:                          $listQuery .= '
>> ORDER BY vtiger_crmentity.modifiedtime DESC';
>> > PriceBooks/models/ListView.php:108:                     $listQuery .= '
>> ORDER BY vtiger_crmentity.modifiedtime DESC';
>> > Products/models/ListView.php:82:                        $listQuery .= '
>> ORDER BY vtiger_crmentity.modifiedtime DESC';
>> > RecycleBin/models/ListView.php:92:                      $listQuery .= '
>> ORDER BY vtiger_crmentity.modifiedtime DESC';
>> > Vtiger/models/RelationListView.php:329:                 $query .= '
>> ORDER BY vtiger_crmentity.modifiedtime DESC';
>> > Vtiger/models/ListView.php:248:                 $listQuery .= ' ORDER
>> BY vtiger_crmentity.modifiedtime DESC';
>> > Vtiger/models/MiniList.php:125:                 $query .= ' ORDER BY
>> vtiger_crmentity.modifiedtime DESC';
>>
>> _______________________________________________
>> http://www.vtiger.com/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20180705/11a2bfbe/attachment-0001.html>


More information about the vtigercrm-developers mailing list