title: Import large csv file with laravel excel and postgresql
body: <p>Hi I have a large csv file with 130.000 rows</p>
  
  <p>I use laravel excel 3.1 and lavaravel 5.8</p>
  
  <p>Import class:</p>
  
  <pre><code>&lt;?php
  
  namespace App\Imports;
  
  use App\UsoSuelo;
  use Maatwebsite\Excel\Concerns\ToModel;
  use Maatwebsite\Excel\Concerns\WithHeadingRow;
  use Maatwebsite\Excel\Concerns\WithChunkReading;
  use Maatwebsite\Excel\Concerns\WithBatchInserts;
  
  class UsoSueloImport implements ToModel, WithHeadingRow, WithChunkReading, WithBatchInserts
  {
      /**
      * @param array $row
      *
      * @return \Illuminate\Database\Eloquent\Model|null
      */
      public function model(array $row)
      {
          return new UsoSuelo([
              'cod_pais'     =&gt; $row['cod_pais'],
              'cod_fundo'     =&gt; $row['cod_fundo'],
              'nom_fundo'     =&gt; $row['nom_fundo'],
  
          ]);
      }
      public function batchSize(): int
      {
          return 1000;
      }
      public function chunkSize(): int
      {
          return 1000;
      }
  }
  </code></pre>
  
  <p>And I use a trait class from my controller: </p>
  
  <pre><code>    trait storeTrait{
  
      public function storeUsoSuelo($archivo) {
          Excel::import(new UsoSueloImport,$archivo); 
      }
      public function storeFundo($archivo) {
          Excel::import(new FundosImport,$archivo); 
      }
      public function storeFundoGrilla($archivo) {
          Excel::import(new FundosGrillasImport,$archivo); 
      }
      public function storeCuadrante($archivo) {
          Excel::import(new CuadrantesImport,$archivo); 
      }
  }
  </code></pre>
  
  <p>This is my ImportController</p>
  
  <pre><code>class ImportController extends Controller
  {
      use storeTrait  {
          storeUsoSuelo as storeUsoSuelos;
          storeFundo as storeFundos;
          storeFundoGrilla as storeFundoGrillas;
          storeCuadrante as storeCuadrantes;
  
      }
      public function store(Request $request)
      {
          $usoSuelo = 'uso_suelo.csv';
          $this-&gt;storeUsoSuelos($usoSuelo);
  
          $cuadrante = 'cuadrantes.csv';
          $this-&gt;storeCuadrantes($cuadrante);
  
          $fundo = 'mv_qav_fundos.csv';
          $this-&gt;storeFundos($fundo);
  
          $fundoGrilla = 'fundos_grilla.csv';
          $this-&gt;storeFundoGrillas($fundoGrilla);
  }
  }
  </code></pre>
  
  <p>I have done tests and my code works with a csv of less than 100 rows
  but when I try with the 130,000 rows it takes too long, and I end up getting the following error:</p>
  
  <pre><code>"Maximum execution time of 60 seconds exceeded"
  </code></pre>
  
  <p>And after 1 minute only 4000 rows have been inserted in the database (postgresql)</p>