Skip to content

Commit e44873c

Browse files
committed
Add further indices to submissions table
These two indices are expected to improve the performance, especially for submission statistics.
1 parent fbc6221 commit e44873c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# frozen_string_literal: true
2+
3+
class AddIndicesToSubmission < ActiveRecord::Migration[7.2]
4+
def change
5+
add_index :submissions, :updated_at, order: {updated_at: :desc}
6+
add_index :submissions, :cause, using: :gin, opclass: :gin_trgm_ops
7+
end
8+
end

db/schema.rb

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)