i have a page for user searching data from specific date range. and it will show result in datatable e.g (ID, Audit type, user, new value, old value etc) and it was from 2 table relationship.
here is my query
$audits = \OwenIt\Auditing\Models\Audit::with('user')->orderBy('updated_at', 'DESC')->where('created_at','>=',$date1)->where('created_at','<=',$date2)->get;
the problem is if amount of data is big, the process so slow. how to optimalize the query?
i try to use paginate(10) or take (10), but it only show 10 data not all data
https://stackoverflow.com/questions/65418381/laravel-query-to-show-big-data-is-slow December 23, 2020 at 10:46AM
没有评论:
发表评论