Datatable Server side processing

Published 1 month ago by user_hkcl

Can someone provide complete code of server side processing of datatable.

Actually I have to display millions of record using datatable which takes so much time.

Best Answer (As Selected By user_hkcl)
awhite

You're displaying millions of records at once or your database contains millions of records and you'll display a subset (page) at a time?

The wonderful thing about DataTables server side processing is that you don't have to display all of the records at once. Similarly, Laravel also supports collection pagination (https://laravel.com/docs/5.6/pagination).

Example from DataTables: https://datatables.net/examples/data_sources/server_side

Good tutorial for Laravel: https://shareurcodes.com/blog/laravel%20datatables%20server%20side%20processing

jlrdw
jlrdw
1 month ago (244,950 XP)

They have examples on their site. And yeah good luck with displaying millions of Records.

awhite

You're displaying millions of records at once or your database contains millions of records and you'll display a subset (page) at a time?

The wonderful thing about DataTables server side processing is that you don't have to display all of the records at once. Similarly, Laravel also supports collection pagination (https://laravel.com/docs/5.6/pagination).

Example from DataTables: https://datatables.net/examples/data_sources/server_side

Good tutorial for Laravel: https://shareurcodes.com/blog/laravel%20datatables%20server%20side%20processing

jlrdw
jlrdw
1 month ago (244,950 XP)

I have to display millions of record using datatable which takes so much time.

Even with pagination, 20 per page. And figure to quickly view what's on a page - 2 to 4 seconds, just to paginate through a million records =

Almost four days.

You said millions, so lets say five million, then it would take:

Over 19 days just to paginate the results.

20,000,000

77 days

A billion

over a year and a half.

That is 20 records per page. One per page would take 32 years.

So you better write a query to narrow the results.

newbie360

after go to that page, ok start loading......, all i care is after me dead, no one come to click the browser stop button on my computer. so sad, can't see the page content when i still alive

SdeWijs

I use this SSP class which is an extension of the serverside datatables class. https://github.com/emran/ssp .

It supports joins and an extra where clause. When using multiple joins on large tables, be sure to create indexes to speed up the query.

Please sign in or create an account to participate in this conversation.