Attachments will be marked as duplicated if they have the same content.
Only the installation starts a background job which checks all existing attachments. The job runs asynchrone and by careful utilization of existing resources to do not slow down the system! Updates e.g. in case of new attachments are event based triggered.