From 764d704d78d9101ca28f938902b691d3b84c3c22 Mon Sep 17 00:00:00 2001 From: Jess Archer Date: Fri, 1 Dec 2023 21:18:26 +1000 Subject: [PATCH] Update indexes --- database/migrations/2023_06_07_000001_create_pulse_tables.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database/migrations/2023_06_07_000001_create_pulse_tables.php b/database/migrations/2023_06_07_000001_create_pulse_tables.php index abe07819..2043f141 100644 --- a/database/migrations/2023_06_07_000001_create_pulse_tables.php +++ b/database/migrations/2023_06_07_000001_create_pulse_tables.php @@ -42,7 +42,7 @@ public function up(): void $table->index('timestamp'); // For trimming... $table->index('type'); // For purging... $table->index('key_hash'); // For mapping... - $table->index(['timestamp', 'type', 'key_hash', 'value']); // TODO: This is a guess... + $table->index(['timestamp', 'type', 'key_hash', 'value']); // For aggregate queries... }); Schema::create('pulse_aggregates', function (Blueprint $table) { @@ -58,7 +58,7 @@ public function up(): void $table->unique(['bucket', 'period', 'type', 'aggregate', 'key_hash']); // Force "on duplicate update"... $table->index(['period', 'bucket']); // For trimming... $table->index('type'); // For purging... - $table->index(['period', 'bucket', 'type']); // TODO: This is a guess... + $table->index(['period', 'type', 'aggregate', 'bucket']); // For aggregate queries... }); }