Datatables slow with +100000 records

Datatables slow with +100000 records

nico0601nico0601 Posts: 2Questions: 0Answers: 0
edited April 2013 in DataTables 1.9
Hi, I'm form argentina. I have probles with datatables. My english is not so good. I will try to explain.
I'm using datatables 1.9.4 Autofill. I have a problem with more than 100000 records.
I agree this script into the head
[code]

$(document).ready( function () {
var oTable = $('#example').dataTable();
new AutoFill( oTable );
} );

[/code]
The plugin works fine with 8000 records but when y try to use all records (+100000) the plugin doesnt work. Its crashed.
Any suggestion? Sorry for my english. I hope to understand.
Thanks

Replies

  • allanallan Posts: 63,386Questions: 1Answers: 10,449 Site admin
    With that mean records, I'd suggest you look at using server-side processing, or at least Ajax loading with deferred rendering: http://datatables.net/faqs#speed

    Allan
  • nico0601nico0601 Posts: 2Questions: 0Answers: 0
    Hi allan, thanks for your help.
    I was looking at the link but I can not make it work.
    I just have to modify the php file? Or should we do something more?
    I cannot see the error
  • allanallan Posts: 63,386Questions: 1Answers: 10,449 Site admin
    I would suggest you use server-side processing: http://datatables.net/usage/server-side

    Allan
  • nico0601nico0601 Posts: 2Questions: 0Answers: 0
    This is the file.

    [code]
    <?php
    $titulo= "Consulta de Declaraciones Juradas";
    include("conexion.php");
    include("validar.php");

    $sql = "SELECT DISTINCT periodo_ddjj, ape_nom_ddjj, afili_ddjj, basico_ddjj, bruto_ddjj, aporte_ddjj, IFNULL(empresa, 'Sin nombre') AS empresa
    FROM ddjj
    LEFT JOIN empresas ON (empresas.cuit = ddjj.cuit_ddjj)";
    $rs = mysql_query($sql);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


    <?php echo ($titulo); ?>



    @import "css/demo_page.css";
    @import "css/demo_table.css";
    @import "css/AutoFill.css";





    $(document).ready(function() {
    $('#example').dataTable( {
    bServerSide: true,
    sAjaxSource: "server_processing.php"
    } );
    } );




    <?php echo ($titulo); ?>
    <!-- Inicio del desarrollo -->



    Consultar Aportes
    Consultar DDJJ
    Salir






    <!--CUIT-->EmpresaPeriodo<!--CUIL-->Apellido y Nombre
    AfiliS. BasicoS. BrutoAporte<!--Convenio-->



    <?php
    while($row=mysql_fetch_array($rs))
    {
    ?>

    <!--<?php //echo($row['cuit_ddjj']);?>-->
    <?php echo($row['empresa']);?>
    <?php echo($row['periodo_ddjj']);?>
    <!--<?php //echo($row['cuil_ddjj']);?>-->
    <?php echo($row['ape_nom_ddjj']);?>
    <?php echo($row['afili_ddjj']);?>
    <?php echo($row['basico_ddjj']);?>
    <?php echo($row['bruto_ddjj']);?>
    <?php echo($row['aporte_ddjj']);?>
    <!--<?php //echo($row['cct_ddjj']);?>-->

    <?php
    }
    ?>







    [/code]

    Thank you
This discussion has been closed.