Maxexecution time exceeded for 20.000 rows

Maxexecution time exceeded for 20.000 rows

dipitdipit Posts: 2Questions: 1Answers: 0

Hi, i use datatables on laravel.
The issue that i have is that i join 4 tables to get all the data and display them to to the user, so i'm getting max time execution error. I'm using serverside

I use the code below to get all the data:
Route::get('/serverSideSymv', [
'as' => 'serverSideSymv',
'uses' => function () {
$symv = App\Symvolaia::Select('table1.*')
->join('table2', 'table1.field1', '=', 'table2.id')
->join('table3', 'table1.field2', '=', 'table3.id')
->leftJoin('table4', function($join)
{
$join->on('table1.field3', '=', 'table4.field5');
$join->on('table1.field6', '=', 'table4.field7');
})
->select('table1.id','table2.field1','table1.field2','table1.field3','table1.field4','table3.field5','table1.field6','table1.field7','table1.field8','table4.field9','table1.field10','table1.field11','table1.field12','table1.field13','table1.field14','table2.field15');
return Datatables::of($symv)
->editColumn('field5', function($data) {
return Illuminate\Support\Facades\Crypt::decrypt($data->field5);
})
->make();
}
]);

Is there any way to optimize the query or somehow show the results in datatables?

Answers

  • dipitdipit Posts: 2Questions: 1Answers: 0
    edited March 2017

    This is how i call the ajax request

            $('#dataTable').DataTable( {
                processing: true,
                responsive: true,
                serverSide: true,
                ajax: '{{ route('serverSideSymv') }}',
    

    Shall it display the first results while it stills processing?

This discussion has been closed.