mirror of
https://github.com/SrIzan10/hc-harbor.git
synced 2026-05-01 10:45:21 +00:00
Add index to commits on user + timestamp
Based on another pg_analyze recommendation
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
class AddIndexToCommitsUserIdCreatedAt < ActiveRecord::Migration[8.0]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def change
|
||||
add_index :commits, [:user_id, :created_at], algorithm: :concurrently
|
||||
end
|
||||
end
|
||||
3
db/schema.rb
generated
3
db/schema.rb
generated
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.0].define(version: 2025_06_09_143856) do
|
||||
ActiveRecord::Schema[8.0].define(version: 2025_06_09_144356) do
|
||||
create_schema "pganalyze"
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
@@ -79,6 +79,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_06_09_143856) do
|
||||
t.datetime "updated_at", null: false
|
||||
t.bigint "repository_id"
|
||||
t.index ["repository_id"], name: "index_commits_on_repository_id"
|
||||
t.index ["user_id", "created_at"], name: "index_commits_on_user_id_and_created_at"
|
||||
t.index ["user_id"], name: "index_commits_on_user_id"
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user