Fix N+1 problem on statuses/public_statuses indices
This commit is contained in:
parent
0ffd8acacd
commit
6aaef5c34e
2 changed files with 2 additions and 1 deletions
|
@ -144,7 +144,7 @@ class PublicStatusesIndex < Chewy::Index
|
||||||
index_scope ::Status.unscoped
|
index_scope ::Status.unscoped
|
||||||
.kept
|
.kept
|
||||||
.indexable
|
.indexable
|
||||||
.includes(:media_attachments, :preloadable_poll, :preview_cards, :tags)
|
.includes(:media_attachments, :preloadable_poll, :preview_cards, :tags, :account)
|
||||||
|
|
||||||
root date_detection: false do
|
root date_detection: false do
|
||||||
field(:id, type: 'long')
|
field(:id, type: 'long')
|
||||||
|
|
|
@ -145,6 +145,7 @@ class StatusesIndex < Chewy::Index
|
||||||
settings index: index_preset(refresh_interval: '30s', number_of_shards: 5), analysis: Rails.env.test? ? DEVELOPMENT_SETTINGS : PRODUCTION_SETTINGS
|
settings index: index_preset(refresh_interval: '30s', number_of_shards: 5), analysis: Rails.env.test? ? DEVELOPMENT_SETTINGS : PRODUCTION_SETTINGS
|
||||||
|
|
||||||
index_scope ::Status.unscoped.kept.without_reblogs.includes(
|
index_scope ::Status.unscoped.kept.without_reblogs.includes(
|
||||||
|
:account,
|
||||||
:media_attachments,
|
:media_attachments,
|
||||||
:preview_cards,
|
:preview_cards,
|
||||||
:local_mentioned,
|
:local_mentioned,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue