#10 时间轴展示对自己的转嘟(转评功能)需要性能优化

Open
opened 2 years ago by OmmyZhang · 0 comments
OmmyZhang commented 2 years ago
Owner

当初做这个功能的时候随手写了个join语句,随着目前嘟文数增多出现严重的性能问题,加载时间轴明显比加载主页慢。

https://git.closed.social/closed-social/mastodon/src/branch/closed-social-v3/app/models/status.rb#L92

  • 优化方案1:改表,增加reblog_of_account_id字段
  • 优化方案2:查表的时候直接不过滤转嘟,通过sql外的逻辑去掉非转嘟自己的。由于转嘟占的总量不大,这个方案可能也是可接受的。注意高赞精选会密集转嘟,可能导致加载的一页嘟文全部被过滤掉。
当初做这个功能的时候随手写了个join语句,随着目前嘟文数增多出现严重的性能问题,加载时间轴明显比加载主页慢。 https://git.closed.social/closed-social/mastodon/src/branch/closed-social-v3/app/models/status.rb#L92 + 优化方案1:改表,增加`reblog_of_account_id`字段 + 优化方案2:查表的时候直接不过滤转嘟,通过sql外的逻辑去掉非转嘟自己的。由于转嘟占的总量不大,这个方案可能也是可接受的。注意高赞精选会密集转嘟,可能导致加载的一页嘟文全部被过滤掉。
OmmyZhang added the
enhancement
label 2 years ago
TA referenced this issue from a commit 2 years ago
OmmyZhang referenced this issue from a commit 2 years ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.