Skip to content

Commit

Permalink
Add further indices to improve slots performance
Browse files Browse the repository at this point in the history
  • Loading branch information
benlovell committed Dec 15, 2024
1 parent c060662 commit 2fa616d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class AddAppointmentsIndexesForSlots < ActiveRecord::Migration[6.1]
def change
add_index :appointments, %i(start_at end_at)
add_index :appointments, :status
end
end
4 changes: 3 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.define(version: 2024_11_25_195323) do
ActiveRecord::Schema.define(version: 2024_12_15_162334) do

# These are extensions that must be enabled in order to support this database
enable_extension "pg_stat_statements"
Expand Down Expand Up @@ -129,7 +129,9 @@
t.index ["guider_id"], name: "index_appointments_on_guider_id"
t.index ["schedule_type"], name: "index_appointments_on_schedule_type"
t.index ["start_at", "end_at", "guider_id"], name: "index_appointments_on_start_at_and_end_at_and_guider_id"
t.index ["start_at", "end_at"], name: "index_appointments_on_start_at_and_end_at"
t.index ["start_at"], name: "index_appointments_on_start_at"
t.index ["status"], name: "index_appointments_on_status"
end

create_table "audits", id: :serial, force: :cascade do |t|
Expand Down

0 comments on commit 2fa616d

Please sign in to comment.