Dont use count(*) but rather count(column) so that indexes can help us
This commit is contained in:
@@ -110,7 +110,7 @@ class Domain extends Model
|
||||
{
|
||||
return Cache::remember(md5(sprintf('%d-%s',$this->id,$systems?->pluck('id')->join(','))),self::CACHE_TIME,function() use ($systems) {
|
||||
return DB::query()
|
||||
->select(['echoareas.name','echoareas.show',DB::raw('COUNT(*) AS count'),DB::raw('datetime::date AS date')])
|
||||
->select(['echoareas.name','echoareas.show',DB::raw('COUNT(echoareas.name) AS count'),DB::raw('datetime::date AS date')])
|
||||
->from($this->getTable())
|
||||
->join('echoareas',['echoareas.domain_id'=>'domains.id'])
|
||||
->join('echomails',['echomails.echoarea_id'=>'echoareas.id'])
|
||||
|
Reference in New Issue
Block a user