1
0
mirror of https://github.com/nerzhul/ocsms.git synced 2025-06-23 15:56:24 +00:00

speed optimization

as count(`fieldname`) does check for NULL values (as they will be excluded) it is faster to use count(*) as the date will never be NULL anyway (NULLs are not allowed at all 😄 )
This commit is contained in:
Martin Rüegg 2015-02-12 21:36:19 +01:00
parent 75e3e409ac
commit 5755ab800f

View File

@ -153,7 +153,7 @@ class SmsMapper extends Mapper {
$cnt = 0; $cnt = 0;
$phlst = $this->getAllPhoneNumbersForFPN ($userId, $phoneNumber, $country); $phlst = $this->getAllPhoneNumbersForFPN ($userId, $phoneNumber, $country);
$query = \OCP\DB::prepare('SELECT count(sms_date) as ct FROM ' . $query = \OCP\DB::prepare('SELECT count(*) as ct FROM ' .
'*PREFIX*ocsms_smsdatas WHERE user_id = ? AND sms_address = ? ' . '*PREFIX*ocsms_smsdatas WHERE user_id = ? AND sms_address = ? ' .
'AND sms_mailbox IN (?,?)'); 'AND sms_mailbox IN (?,?)');