Table taking lifetime to run

Table taking lifetime to run

edonitiedoniti Posts: 3Questions: 0Answers: 0
edited December 2011 in General
Hello to you all.

I have dataTables 1.8.2, and I need to display rows from mysql, there are about 25000 rows, but the loading is taking to long, the browser wants to kill the webpage. I even have another table with 600 rows, that too is taking to much time. Is there any solution to make it faster? Or I have to use usually pagination with php?

Best regards.

Replies

  • btzbtz Posts: 22Questions: 0Answers: 0
    How long does it take to fetch those 25000 rows from DB without datatables?
    You're using serverside: true?

    I have ~390 columns and 50 rows, fetching data to table from ~18000 row DB takes about 3 seconds.
  • edonitiedoniti Posts: 3Questions: 0Answers: 0
    edited December 2011
    For example showing 600 rows without datatables it takes 2-3 seconds, with it it takes more than 1 minutes I think.

    How you mean you are using serverside: true?
  • allanallan Posts: 63,538Questions: 1Answers: 10,476 Site admin
    600 rows shouldn't take more than a second to initialise. If you have a link to the page, then that would be very useful to let me see what the issue might be as I can then profile it.

    Two questions that I've found to be an issue before: is the table hidden (display: none) when you initialise it, and are you using IE? If so, that's the issue - IE does something very odd when parsing the DOM for hidden elements.

    For 25'000 rows I'd suggest looking are using Ajax source loading with deferred rendering: http://datatables.net/release-datatables/examples/ajax/defer_render.html

    Alternatively as btw says, you could consider server-side processing ( http://datatables.net/release-datatables/examples/data_sources/server_side.html ) which will deal with many millions of rows in a fraction of a second.

    Allan
  • edonitiedoniti Posts: 3Questions: 0Answers: 0
    Thanks a lot, now with server-side processing it is ok, it runs very fast. But I have another problem now:S I use jquery to change select box design and to update some fields using that select box, but it is not working:S It seems like it is not taking effects on tables with server side processing. Any idea how to solve this?
  • allanallan Posts: 63,538Questions: 1Answers: 10,476 Site admin
    > It seems like it is not taking effects on tables with server side processing.

    I'd be willing to bet that you are using 'static' events rather than live ones :-). Have a look at http://datatables.net/faqs#ss_events - I'd suggest using live events to cope with it.

    Good to hear that the speed has improved!

    Allan
This discussion has been closed.