mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 08:57:10 -06:00
DEV: add topic_id index to incoming_emails table (#26004)
This table may grow to be large, and an index on this column improves performance for SELECT queries.
This commit is contained in:
parent
718a91c297
commit
f880f1a42f
@ -104,5 +104,6 @@ end
|
||||
# index_incoming_emails_on_imap_sync (imap_sync)
|
||||
# index_incoming_emails_on_message_id (message_id)
|
||||
# index_incoming_emails_on_post_id (post_id)
|
||||
# index_incoming_emails_on_topic_id (topic_id)
|
||||
# index_incoming_emails_on_user_id (user_id) WHERE (user_id IS NOT NULL)
|
||||
#
|
||||
|
@ -0,0 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
class TopicIdOnIncomingEmailIndex < ActiveRecord::Migration[7.0]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def change
|
||||
add_index :incoming_emails, :topic_id, algorithm: :concurrently
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user