Performance Optimizations:

1. Add index on testrun.submissionId
2. replace lti_parameters.size with lti_parameters.present? to prevent COUNT query

Signed-off-by: Sebastian Serth <Sebastian.Serth@student.hpi.de>
This commit is contained in:
Sebastian Serth
2018-08-23 17:29:14 +02:00
parent 40492479ba
commit 6bd1dac756
3 changed files with 10 additions and 3 deletions

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20180815115351) do
ActiveRecord::Schema.define(version: 20180823135317) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -383,6 +383,8 @@ ActiveRecord::Schema.define(version: 20180815115351) do
t.string "cause"
end
add_index "testruns", ["submission_id"], name: "index_testruns_on_submission_id", using: :btree
create_table "user_exercise_feedbacks", force: :cascade do |t|
t.integer "exercise_id", null: false
t.integer "user_id", null: false