title: DataTable loading time is too slow
body: <p>Well guys, i got a problem there, i was happy because i did that the table (dataTable) work in my project, but testing how much rows can be support my project, these are the times:
  2000 rows: 4 seconds to show.
  8000 rows: 40 seconds to show.
  20000 rows: incalculated :( </p>
  
  <p>I am using Angular 7, Nodejs, PostgreSQL, express, jquery for the table library.
  This is my code: </p>
  
  <p>The component of the registers: (list.ts) -- Here I call to dataTable and I config it --</p>
  
  <pre><code>export class ListComponent implements OnInit {
    users$: any[] = [];
    dtOptions: DataTables.Settings = {};
    dtTrigger: Subject&lt;any&gt; = new Subject();
  
    public denuncias: Denuncia[];
    constructor(
      private _denunciaService: DenunciaService
    ) {
  
    }
  
    ngOnInit(): void {
      this.dtOptions = {
        "paging": true,
        language: {
          processing: "Procesando...",
          search: "Buscar:",
          lengthMenu: "Mostrar _MENU_ registros",
          info: "Mostrando elementos del _START_ al _END_ de un total de _TOTAL_ registros",
          infoEmpty: "No existen registros",
          infoFiltered: "(Filtrados _MAX_ elementos en total).",
          infoPostFix: "",
          loadingRecords: "Cargando....",
          zeroRecords: "No existen registros de denuncias",
          emptyTable: "No se encontraron resultados.",
          paginate: {
            first: "Primer",
            previous: "Anterior",
            next: "Siguiente",
            last: "Último"
          },
          aria: {
            sortAscending: ": Activar para ordenar ascendentemente",
            sortDescending: ": Activar para ordenar descendentemente"
          }
        }
      };
      this.getDenuncias();
    }
  
    getDenuncias() {
      this._denunciaService.getDenunciasxd().subscribe(response =&gt; {
        this.denuncias = response.data;
        this.dtTrigger.next();
      },
        error =&gt; {
          console.log(&lt;any&gt;error);
        })
    }
  
    ngOnDestroy(): void {
      this.dtTrigger.unsubscribe();
    }
  }
  </code></pre>
  
  <p>and this is the code HTML</p>
  
  <pre><code>&lt;table class="table table-hover table-bordered" datatable [dtOptions]="dtOptions" [dtTrigger]="dtTrigger"&gt;
          &lt;thead class=""&gt;
              &lt;tr&gt;
                  &lt;th id="ID"&gt;ID&lt;/th&gt;
                  &lt;th id="FACULTAD"&gt;Locacion&lt;/th&gt;
                  &lt;th id="DETALLE"&gt;Detalle de los hechos&lt;/th&gt;
                  &lt;th id="FECHA"&gt;Fecha&lt;/th&gt;
                  &lt;th id="ESTADO"&gt;Estado&lt;/th&gt;
                  &lt;th id="DELETE"&gt;Detalle&lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody class="align-middle"&gt;
              &lt;tr *ngFor="let denuncia of denuncias" class="align-middle"&gt;
                  &lt;td class="align-middle" style="font-family: consolas"&gt;
                      {{denuncia.numeroDenuncia}}
                  &lt;/td&gt;
                  &lt;td class="align-middle"&gt;
                      {{denuncia.FacultadDependencia}}
                  &lt;/td&gt;
                  &lt;td class="align-middle"&gt;
                      {{denuncia.detalleHechos}}
                  &lt;/td&gt;
                  &lt;td class="align-middle"&gt;
                      {{denuncia.fechaDenuncia}}
                  &lt;/td&gt;
                  &lt;td class="align-middle"&gt;
                      {{denuncia.Estado}}
                  &lt;/td&gt;
                  &lt;td class="align-middle"&gt;
                      &lt;a class="button" title="Aprende a crear un blog" href="/delete/&lt;%= data[i].numeroDenuncia %&gt;"&gt;&lt;/a&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/tbody&gt;
      &lt;/table&gt;
  </code></pre>
  
  <p>This is the controller in the backend:</p>
  
  <pre><code>const controller = {};
  const { Pool } = require('pg');
  
  var connectionString = 'postgres://me:system@localhost/antisobornodb';
  const pool = new Pool({
      connectionString: connectionString,
  })
  
  controller.listar = async(request, response) =&gt; {
      try {
          const result = await pool.query(
              'SELECT "detalleHechos", "Estado","numeroDenuncia","FacultadDependencia","Estado","fechaDenuncia" ' +
              'FROM tb_anonima UNION ALL ' +
              'SELECT "detalleHechos", "Estado","numeroDenuncia","FacultadDependencia","Estado","fechaDenuncia" ' +
              'FROM tb_juridica UNION ALL ' +
              'SELECT "detalleHechos", "Estado","numeroDenuncia","FacultadDependencia","Estado","fechaDenuncia" ' +
              'from tb_natural');
          // return response.render('registros', );
          return response.status(200).send({ data: result.rows });
      } catch (err) {
          // return next(err);
          console.log(err);
      }
  };
  module.exports = controller;
  </code></pre>
  
  <p>This code works pretty well but just with 1-1500 rows i think, i don't need millions of rows, it's a little project for my job, maybe the maximum rows that i need to read will be 15000 or 20000,no more. </p>
  
  <p>Thanks in advance :D </p>