doesnthave() taking too long to query in laravel

I am write database query which fetch the record which does not have specific relation i am simply counting the number of records which doesn't have relation . But it is taking too long .

Here is my query

 Consignment::doesntHave('invoice_charges')->count()

But when I write query without relation it gives me quick result


Consignment::count()

What could be the reason . And how i can make it work?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/32HhGHY
via IFTTT

تعليقات

المشاركات الشائعة من هذه المدونة

I am unable to figure out how to create payment collection request, after a form has been submitted in laravel

laravel, mysql transaction not working after failed one time