Some query optimisations when rendering status, dashboard, about and FTN list pages
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 45s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m51s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s

This commit is contained in:
2024-09-10 13:05:43 +10:00
parent 67f0e3007e
commit 2d75c92afb
2 changed files with 39 additions and 1 deletions

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('echomails', function (Blueprint $table) {
$table->index(['created_at']);
$table->index(['datetime']);
});
DB::statement('CREATE INDEX echomail_seenby_unsent ON echomail_seenby (address_id,echomail_id) WHERE sent_at IS NULL AND export_at IS NOT NULL;');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('echomails', function (Blueprint $table) {
$table->dropIndex(['created_at']);
$table->dropIndex(['datetime']);
});
DB::statement('DROP INDEX echomail_seenby_unsent');
}
};