The personal finance app for everyone
perf: Add index to sync status (#2337)
Iuri G.1d2e7fcae096
diff --git a/db/migrate/20250605031616_add_index_to_sync_status.rb b/db/migrate/20250605031616_add_index_to_sync_status.rbnew file mode 100644index 00000000..d1187a35--- /dev/null+++ b/db/migrate/20250605031616_add_index_to_sync_status.rb@@ -0,0 +1,7 @@+class AddIndexToSyncStatus < ActiveRecord::Migration[7.2]+ disable_ddl_transaction!++ def change+ add_index :syncs, :status, if_not_exists: true, algorithm: :concurrently+ end+enddiff --git a/db/schema.rb b/db/schema.rbindex b5f41eab..c38c5375 100644--- a/db/schema.rb+++ b/db/schema.rb@@ -10,7 +10,7 @@## It's strongly recommended that you check this file into your version control system.-ActiveRecord::Schema[7.2].define(version: 2025_05_23_131455) do+ActiveRecord::Schema[7.2].define(version: 2025_06_05_031616) do# These are extensions that must be enabled in order to support this databaseenable_extension "pgcrypto"enable_extension "plpgsql"@@ -593,6 +593,7 @@ ActiveRecord::Schema[7.2].define(version: 2025_05_23_131455) dot.date "window_start_date"t.date "window_end_date"t.index ["parent_id"], name: "index_syncs_on_parent_id"+ t.index ["status"], name: "index_syncs_on_status"t.index ["syncable_type", "syncable_id"], name: "index_syncs_on_syncable"end