From 215148ca814bc0a664f05063ee804c3d7eef24b1 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Fri, 23 Aug 2024 15:09:58 +0200 Subject: [PATCH] :zap: Add better fillfactor setting for storage_object and task tables --- backend/src/app/migrations.clj | 8 +++++++- .../app/migrations/sql/0127-mod-storage-object-table.sql | 3 +++ backend/src/app/migrations/sql/0128-mod-task-table.sql | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 backend/src/app/migrations/sql/0127-mod-storage-object-table.sql create mode 100644 backend/src/app/migrations/sql/0128-mod-task-table.sql diff --git a/backend/src/app/migrations.clj b/backend/src/app/migrations.clj index a66110fb54..112ea6be09 100644 --- a/backend/src/app/migrations.clj +++ b/backend/src/app/migrations.clj @@ -400,7 +400,13 @@ :fn (mg/resource "app/migrations/sql/0125-mod-file-table.sql")} {:name "0126-add-team-access-request-table" - :fn (mg/resource "app/migrations/sql/0126-add-team-access-request-table.sql")}]) + :fn (mg/resource "app/migrations/sql/0126-add-team-access-request-table.sql")} + + {:name "0127-mod-storage-object-table" + :fn (mg/resource "app/migrations/sql/0127-mod-storage-object-table.sql")} + + {:name "0128-mod-task-table" + :fn (mg/resource "app/migrations/sql/0128-mod-task-table.sql")}]) (defn apply-migrations! [pool name migrations] diff --git a/backend/src/app/migrations/sql/0127-mod-storage-object-table.sql b/backend/src/app/migrations/sql/0127-mod-storage-object-table.sql new file mode 100644 index 0000000000..521a3fcb0a --- /dev/null +++ b/backend/src/app/migrations/sql/0127-mod-storage-object-table.sql @@ -0,0 +1,3 @@ +--- This setting allow to optimize the table for heavy write workload +--- leaving space on the page for HOT updates +ALTER TABLE storage_object SET (FILLFACTOR=60); diff --git a/backend/src/app/migrations/sql/0128-mod-task-table.sql b/backend/src/app/migrations/sql/0128-mod-task-table.sql new file mode 100644 index 0000000000..97fcdbeef0 --- /dev/null +++ b/backend/src/app/migrations/sql/0128-mod-task-table.sql @@ -0,0 +1,3 @@ +--- This setting allow to optimize the table for heavy write workload +--- leaving space on the page for HOT updates +ALTER TABLE task SET (FILLFACTOR=60);