From aaeb7b64e90dd09f5b20c4a8e71676fb630c0272 Mon Sep 17 00:00:00 2001 From: osaajani <> Date: Tue, 6 Jun 2023 18:39:48 +0200 Subject: [PATCH 1/2] Add index on sms timestamps for perfs --- ...0606151521_add_index_to_sms_timestamps.php | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 db/migrations/20230606151521_add_index_to_sms_timestamps.php diff --git a/db/migrations/20230606151521_add_index_to_sms_timestamps.php b/db/migrations/20230606151521_add_index_to_sms_timestamps.php new file mode 100644 index 0000000..53228de --- /dev/null +++ b/db/migrations/20230606151521_add_index_to_sms_timestamps.php @@ -0,0 +1,24 @@ +table('sended'); + $table->addIndex('at'); + $table->update(); + + $table = $this->table('received'); + $table->addIndex('at'); + $table->update(); + + $table = $this->table('scheduled'); + $table->addIndex('at'); + $table->update(); + } +} From 347084b5c466d793d6fa19bbc7a95ea843e27233 Mon Sep 17 00:00:00 2001 From: osaajani <> Date: Tue, 6 Jun 2023 20:32:04 +0200 Subject: [PATCH 2/2] improve perfs on status update by sizing down uid and adding an index --- ...20230606180455_add_index_on_sended_uid.php | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 db/migrations/20230606180455_add_index_on_sended_uid.php diff --git a/db/migrations/20230606180455_add_index_on_sended_uid.php b/db/migrations/20230606180455_add_index_on_sended_uid.php new file mode 100644 index 0000000..06ea6e9 --- /dev/null +++ b/db/migrations/20230606180455_add_index_on_sended_uid.php @@ -0,0 +1,24 @@ +table('sended'); + $table->changeColumn('uid', 'string', ['limit' => 100]); + $table->addIndex('uid'); + $table->update(); + + + $table = $this->table('call'); + $table->changeColumn('uid', 'string', ['limit' => 100]); + $table->addIndex('uid'); + $table->update(); + } +}