Vote #78224
完了Add an index on attachments.disk_filename
0%
説明
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.
--------------------------------------------------------------------------------