From e2d4c35f23c479c85d02f9c8c7472eb4b8d96888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20LEUILLIOT?= Date: Tue, 4 Jan 2022 14:32:15 +0100 Subject: [PATCH] feat: improve character wallet journal performances add two new indexes to reduce query time for character ratting metrics on dashboard. ref_type + first_party_id ref_type + second_party_id Closes eveseat/seat#853 --- ...d_into_character_wallet_journals_table.php | 52 +++++++++++++++++++ ...d_into_character_wallet_journals_table.php | 52 +++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 src/database/migrations/2022_01_04_132020_add_index_ref_type_first_party_id_into_character_wallet_journals_table.php create mode 100644 src/database/migrations/2022_01_04_132249_add_index_ref_type_second_party_id_into_character_wallet_journals_table.php diff --git a/src/database/migrations/2022_01_04_132020_add_index_ref_type_first_party_id_into_character_wallet_journals_table.php b/src/database/migrations/2022_01_04_132020_add_index_ref_type_first_party_id_into_character_wallet_journals_table.php new file mode 100644 index 00000000..e156a911 --- /dev/null +++ b/src/database/migrations/2022_01_04_132020_add_index_ref_type_first_party_id_into_character_wallet_journals_table.php @@ -0,0 +1,52 @@ +index(['ref_type', 'first_party_id']); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('character_wallet_journals', function (Blueprint $table) { + $table->dropIndex(['ref_type', 'first_party_id']); + }); + } +} diff --git a/src/database/migrations/2022_01_04_132249_add_index_ref_type_second_party_id_into_character_wallet_journals_table.php b/src/database/migrations/2022_01_04_132249_add_index_ref_type_second_party_id_into_character_wallet_journals_table.php new file mode 100644 index 00000000..f2893a22 --- /dev/null +++ b/src/database/migrations/2022_01_04_132249_add_index_ref_type_second_party_id_into_character_wallet_journals_table.php @@ -0,0 +1,52 @@ +index(['ref_type', 'second_party_id']); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('character_wallet_journals', function (Blueprint $table) { + $table->dropIndex(['ref_type', 'second_party_id']); + }); + } +}