feat(database,performance): optimize indexing and processing for statement export
- Menambahkan indeks baru pada table `stmt_entry`: - Kombinasi indeks untuk kolom `account_number` dan `booking_date`. - Indeks untuk kolom `date_time`. - Indeks untuk kolom `trans_reference`. - Memperbesar ukuran chunk processing di `ExportStatementJob` dari 500 menjadi 1000 untuk mengoptimalkan performa proses ekspor data dan mengurangi overhead. Perubahan ini bertujuan untuk meningkatkan efisiensi query pada table `stmt_entry` dan mengurangi waktu proses pada job ekspor pernyataan.
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
protected $saldo;
|
||||
protected $disk;
|
||||
protected $fileName;
|
||||
protected $chunkSize = 500; // Proses data dalam chunk untuk mengurangi penggunaan memori
|
||||
protected $chunkSize = 1000; // Proses data dalam chunk untuk mengurangi penggunaan memori
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('stmt_entry', function (Blueprint $table) {
|
||||
$table->index(['account_number', 'booking_date']);
|
||||
$table->index(['date_time']);
|
||||
$table->index(['trans_reference']);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user