how to reduce the table loading time when more data

how to reduce the table loading time when more data

SandeepMuralaSandeepMurala Posts: 48Questions: 13Answers: 0

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    This section of the FAQ should help, it discusses various techniques to improve performance,

    Cheers,

    Colin

  • SandeepMuralaSandeepMurala Posts: 48Questions: 13Answers: 0

    Hi ,
    I am using mongodb database, I am using induvial column search datatable as shown here https://jsfiddle.net/dipakthoke07/ehhfsrfq/2/.

    Now I have 15 columns and more then 2k or 5k data (records) ,it might be 10k also,
    problem is when i refresh the page table is taking more time to load and fit in page , the time is taking more then 20 sec ,if it will be more then 10k records ,the loading time will increase more,

    How can I reduce the time to loading .

    Please do help on it .

    Thanks
    Sandeep

  • SandeepMuralaSandeepMurala Posts: 48Questions: 13Answers: 0

    @colin Thanks for your response ,I have checked that FAQ but I did not get my Ans please help on it .

    thanks
    sandeep.

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951
    edited February 2022

    problem is when i refresh the page table is taking more time to load and fit in page

    Your test case is using DOM sourced data, is that the data source for Datatables in your environment?

    Please provide more information of what you have and where the delay is, ie, is the delay in fetching the data from the server or rendering the data. The FAQ Colin linked to provides the options available depending on the where Datatables gets the data from and where the delay is at.

    Kevin

  • SandeepMuralaSandeepMurala Posts: 48Questions: 13Answers: 0

    @kthorngren thanks for your response.

    if we use mysql database we can user server side scripting ,that I have done by using server.php and ssp.class.php and home page, with that I did not get any issue, It was working fine, I was able to manage more then 10k records within 10 sec.

    But now I am using Mongodb and my select query is shown below

    date_default_timezone_set('asia/kolkata');
                                $mongo = new MongoDB\Driver\Manager("mongodb://localhost:27017");    
                                $bulk = new MongoDB\Driver\BulkWrite;
                                $filter = [ "user" => "$user"];  
                                $options = [ 'sort' => ['created_date' => -1] ];
                                $qry = new MongoDB\Driver\Query($filter,$options);
                                $date = date("Y-m-d H:i:s");
                                $rows = $mongo->executeQuery("testdb.test", $qry); 
    
    
    

    by using above query I am fetching records and here records count is more then 3k ,
    after few days it i will go more then 10k also, to load this data in to table is taking more then 30 sec or more I can and I created indexes also mongodb ,

    still same issue,

    And I am using induvial column search datatable as shown here https://jsfiddle.net/dipakthoke07/ehhfsrfq/2/,

    In this induvial column search I have written some custom js code like in individual data search I can search range wise like if age is there ,I can search like in age column 2-5 ,I will get in between 2 to 5 ,so like this i applied few of the columns and if it is text column we can search like ``test|test1|test```.

    How can I fix this loading issue please do help on it ,that is going to helpful for me.

    Thanks
    Sandeep

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951

    if we use mysql database we can user server side scripting ,that I have done by using server.php and ssp.class.php

    In this case you are using server side processing. All of the searching, sorting and paging functions are controlled by the server script, ssp.class.php for example.

    You will need to do something similar with your mongo db to fetch only the records for the current page displayed. See this thread.

    Kevin

Sign In or Register to comment.