Server Side Processing - Not only for Giant Data Sets!

Server Side Processing - Not only for Giant Data Sets!

monkeyboymonkeyboy Posts: 60Questions: 19Answers: 0
edited December 2015 in DataTables 1.10

I see a great deal of discussion regarding appropriate need for server side processing. The consensus seems to be, that it is only useful for dealing with large data sets.
Consider a "summary" table with the following content:
1) The count of all rows where the name is Bob
2) The count of all rows where the name is Alice
3) the sum of all rows where the supervisor is Bob
.....

The real issue here, is that the data for the table cannot be generated by a SINGLE query. This is not something that will work with Joins

Think of this report as an excel pivot table. If anyone knows how to do this in a datatables supported query, I would love to hear from you.

Until then I am stuck using server side processing for my 5 row table

Replies

  • glendersonglenderson Posts: 231Questions: 11Answers: 29
    edited December 2015

    Server Side Processing is when the server returns a subset of the data set. That is, instead of returning 100,000 records, it only returns 100. In your example, you are not representing a server side issue, rather, a you seem to have a query issue.

    You can call an ajax page whether you are using server side or not. Again, the difference is that in server side, you return only a portion of the records. In native dataTable processing, all records are returned. dataTables handles 1000s of records without a performance issue.

    You probably want to craft your own ajax page (you don't need server side) and not rely on dataTables scripting for your query / ajax page.

    sql = Select (select count(*) where name=t1.name) as occurrences, (select count(*) where manager=t1.name) as reports, * from employees as t1
    
    
    Open connection to database
    Open myreader to connection
    Apply SQL
    do while myreader.read()
    write json formatted response
    loop
    

    I could have also done the above in 3 separate SQL statements, load the data into an class collection, then iterated over the collection to send the response.

    Server Side not necessary.

  • monkeyboymonkeyboy Posts: 60Questions: 19Answers: 0

    Thank-you for the insightful response! That clears up some confusion.

This discussion has been closed.