Skip to content

Commit

Permalink
Add missing index to AlertRuns
Browse files Browse the repository at this point in the history
There is a query counting on the AlertRuns for today and, given the size
of the table, it takes long time due to the lack of an index for the
date field.
  • Loading branch information
scruti committed Jan 13, 2025
1 parent 8a01dcb commit 95e2c1d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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_01_07_110428) do
ActiveRecord::Schema[7.2].define(version: 2025_01_13_131902) do
# These are extensions that must be enabled in order to support this database
enable_extension "btree_gist"
enable_extension "citext"
Expand Down Expand Up @@ -56,6 +56,7 @@
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.integer "status", default: 0
t.index ["run_on"], name: "index_alert_runs_on_run_on"
t.index ["subscription_id"], name: "index_alert_runs_on_subscription_id"
end

Expand Down

0 comments on commit 95e2c1d

Please sign in to comment.