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
6558ed491a
commit
115b00145d
5 changed files with 31 additions and 10 deletions
3
Gemfile
3
Gemfile
|
|
@ -81,6 +81,9 @@ group :development do
|
|||
gem "nested_scaffold"
|
||||
gem "rack-livereload"
|
||||
# gem 'reek', require: false
|
||||
gem "dexter"
|
||||
gem "pghero"
|
||||
gem "pg_query", ">= 2"
|
||||
gem "rubocop", require: false
|
||||
gem "seed_dump"
|
||||
gem "solargraph-reek"
|
||||
|
|
|
|||
11
Gemfile.lock
11
Gemfile.lock
|
|
@ -137,6 +137,8 @@ GEM
|
|||
database_cleaner-core (~> 2.0.0)
|
||||
database_cleaner-core (2.0.1)
|
||||
date (3.3.4)
|
||||
dexter (0.1.0)
|
||||
trollop
|
||||
diff-lcs (1.5.0)
|
||||
docile (1.4.0)
|
||||
dotenv (2.8.1)
|
||||
|
|
@ -176,6 +178,7 @@ GEM
|
|||
activerecord (>= 4.0.0)
|
||||
globalid (1.2.1)
|
||||
activesupport (>= 6.1)
|
||||
google-protobuf (3.25.1)
|
||||
guard (2.18.1)
|
||||
formatador (>= 0.2.4)
|
||||
listen (>= 2.7, < 4.0)
|
||||
|
|
@ -266,6 +269,10 @@ GEM
|
|||
ast (~> 2.4.1)
|
||||
racc
|
||||
pg (1.5.4)
|
||||
pg_query (5.0.0)
|
||||
google-protobuf (>= 3.22.3)
|
||||
pghero (3.4.0)
|
||||
activerecord (>= 6)
|
||||
pry (0.14.2)
|
||||
coderay (~> 1.1)
|
||||
method_source (~> 1.0)
|
||||
|
|
@ -428,6 +435,7 @@ GEM
|
|||
tilt (2.3.0)
|
||||
timecop (0.9.8)
|
||||
timeout (0.4.1)
|
||||
trollop (2.9.10)
|
||||
turbo-rails (1.5.0)
|
||||
actionpack (>= 6.0.0)
|
||||
activejob (>= 6.0.0)
|
||||
|
|
@ -468,6 +476,7 @@ DEPENDENCIES
|
|||
cuprite
|
||||
database_cleaner
|
||||
devise!
|
||||
dexter
|
||||
dotenv-rails
|
||||
ed25519
|
||||
erb_lint
|
||||
|
|
@ -486,6 +495,8 @@ DEPENDENCIES
|
|||
nokogiri
|
||||
parallel_tests
|
||||
pg
|
||||
pg_query (>= 2)
|
||||
pghero
|
||||
puma (>= 6.4.0)
|
||||
rack-livereload
|
||||
rack-mini-profiler
|
||||
|
|
|
|||
|
|
@ -2,14 +2,16 @@ Rails.application.routes.draw do
|
|||
resources :districts do
|
||||
resources :schools, only: %i[index show] do
|
||||
resources :overview, only: [:index]
|
||||
resources :categories, only: [:show], path: 'browse'
|
||||
resources :categories, only: [:show], path: "browse"
|
||||
resources :analyze, only: [:index]
|
||||
end
|
||||
end
|
||||
|
||||
get :reports, to: 'reports#index'
|
||||
get 'reports/gps', to: 'gps#index'
|
||||
get :reports, to: "reports#index"
|
||||
get "reports/gps", to: "gps#index"
|
||||
|
||||
get '/welcome', to: 'home#index'
|
||||
root to: 'home#index'
|
||||
get "/welcome", to: "home#index"
|
||||
root to: "home#index"
|
||||
|
||||
# mount PgHero::Engine, at: "pghero" # remove in development env to see suggestions at localhost:3000/pghero
|
||||
end
|
||||
|
|
|
|||
9
db/migrate/20231227183313_remove_unneeded_indexes.rb
Normal file
9
db/migrate/20231227183313_remove_unneeded_indexes.rb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
class RemoveUnneededIndexes < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
remove_index :response_rates, name: "index_response_rates_on_school_id", column: :school_id
|
||||
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 "plpgsql"
|
||||
|
||||
|
|
@ -360,7 +360,6 @@ ActiveRecord::Schema[7.1].define(version: 2023_10_04_211430) do
|
|||
t.datetime "updated_at", null: false
|
||||
t.index ["academic_year_id"], name: "index_response_rates_on_academic_year_id"
|
||||
t.index ["school_id", "subcategory_id"], name: "index_response_rates_on_school_id_and_subcategory_id"
|
||||
t.index ["school_id"], name: "index_response_rates_on_school_id"
|
||||
t.index ["subcategory_id"], name: "index_response_rates_on_subcategory_id"
|
||||
end
|
||||
|
||||
|
|
@ -421,7 +420,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 +461,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