mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
perf: add pghero and implement pghero suggestions. Remove unneeded indexes
This commit is contained in:
parent
edbb84334a
commit
978942ab34
5 changed files with 29 additions and 5 deletions
8
db/migrate/20231227183313_remove_unneeded_indexes.rb
Normal file
8
db/migrate/20231227183313_remove_unneeded_indexes.rb
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
class RemoveUnneededIndexes < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
remove_index :student_races, name: "index_student_races_on_student_id", column: :student_id
|
||||
remove_index :survey_item_responses, name: "index_survey_item_responses_on_school_id", column: :school_id
|
||||
remove_index :survey_item_responses, name: "index_survey_item_responses_on_school_id_and_academic_year_id",
|
||||
column: %i[school_id academic_year_id]
|
||||
end
|
||||
end
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.1].define(version: 2023_10_04_211430) do
|
||||
ActiveRecord::Schema[7.1].define(version: 2023_12_27_183313) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pg_stat_statements"
|
||||
enable_extension "plpgsql"
|
||||
|
|
@ -421,7 +421,6 @@ ActiveRecord::Schema[7.1].define(version: 2023_10_04_211430) do
|
|||
t.datetime "updated_at", null: false
|
||||
t.index ["race_id"], name: "index_student_races_on_race_id"
|
||||
t.index ["student_id", "race_id"], name: "index_student_races_on_student_id_and_race_id"
|
||||
t.index ["student_id"], name: "index_student_races_on_student_id"
|
||||
end
|
||||
|
||||
create_table "students", force: :cascade do |t|
|
||||
|
|
@ -463,9 +462,7 @@ ActiveRecord::Schema[7.1].define(version: 2023_10_04_211430) do
|
|||
t.index ["income_id"], name: "index_survey_item_responses_on_income_id"
|
||||
t.index ["response_id"], name: "index_survey_item_responses_on_response_id"
|
||||
t.index ["school_id", "academic_year_id", "survey_item_id"], name: "by_school_year_and_survey_item"
|
||||
t.index ["school_id", "academic_year_id"], name: "index_survey_item_responses_on_school_id_and_academic_year_id"
|
||||
t.index ["school_id", "survey_item_id", "academic_year_id", "grade"], name: "index_survey_responses_on_grade"
|
||||
t.index ["school_id"], name: "index_survey_item_responses_on_school_id"
|
||||
t.index ["sped_id"], name: "index_survey_item_responses_on_sped_id"
|
||||
t.index ["student_id"], name: "index_survey_item_responses_on_student_id"
|
||||
t.index ["survey_item_id"], name: "index_survey_item_responses_on_survey_item_id"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue