プロジェクト

全般

プロフィール

Vote #78224

完了

Add an index on attachments.disk_filename

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Performance_53
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
53
version_id:
119
issue_org_id:
25022
author_id:
40856
assigned_to_id:
1
comments:
2
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

In a system with lots of attachments deleting one attachment can take very long due to the DB lookup in @Attachment#delete_from_disk@ which checks if the same physical file is used by any other attachment.

We had this issue at Planio in a setup with more than 500k attachments, where deleting a single one could take up to half a second. This patch adds an index on @attachments.disk_filename@ that fixed the issue for us.


journals

Thanks for sharing the experience and the patch.
Setting target version to 3.4.0.

@Attachment#delete_from_disk@: source:tags/3.3.2/app/models/attachment.rb#L145

--------------------------------------------------------------------------------
That should be usefull indeed, thanks.
--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリPerformance_53 にセット
  • 対象バージョン3.4.0_119 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0