mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-18 00:54:49 +01:00
add index on stream_entries table (#5793)
This commit is contained in:
parent
f0d4c7d7ab
commit
dc1ebd45a3
7
db/migrate/20171129172043_add_index_on_stream_entries.rb
Normal file
7
db/migrate/20171129172043_add_index_on_stream_entries.rb
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
class AddIndexOnStreamEntries < ActiveRecord::Migration[5.1]
|
||||||
|
def change
|
||||||
|
commit_db_transaction
|
||||||
|
add_index :stream_entries, [:account_id, :activity_type, :id], algorithm: :concurrently
|
||||||
|
remove_index :stream_entries, name: :index_stream_entries_on_account_id
|
||||||
|
end
|
||||||
|
end
|
@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20171125190735) do
|
ActiveRecord::Schema.define(version: 20171129172043) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
@ -431,7 +431,7 @@ ActiveRecord::Schema.define(version: 20171125190735) do
|
|||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
t.boolean "hidden", default: false, null: false
|
t.boolean "hidden", default: false, null: false
|
||||||
t.bigint "account_id"
|
t.bigint "account_id"
|
||||||
t.index ["account_id"], name: "index_stream_entries_on_account_id"
|
t.index ["account_id", "activity_type", "id"], name: "index_stream_entries_on_account_id_and_activity_type_and_id"
|
||||||
t.index ["activity_id", "activity_type"], name: "index_stream_entries_on_activity_id_and_activity_type"
|
t.index ["activity_id", "activity_type"], name: "index_stream_entries_on_activity_id_and_activity_type"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user