Skip to content

feat: lower disk usage during migration #18440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2025
Merged

Conversation

mertalev
Copy link
Contributor

Description

Dropping the old index outside of a transaction means it can be removed immediately without waiting for the transaction to commit. Since the migration already handles the case when the index is missing, it shouldn't impact the robustness of the migration. Vacuuming after the changes helps free disk space more quickly as well. This would happen eventually on its own, but over a longer period of time and with higher peak disk usage.

There's still a lot of writing in this section, specifically when changing the data types, but it's harder to optimize for disk usage beyond this without making the migration less robust.

@zackpollard zackpollard merged commit bc8e08f into main May 22, 2025
54 of 55 checks passed
@zackpollard zackpollard deleted the feat/less-disk-usage branch May 22, 2025 07:41
savely-krasovsky pushed a commit to savely-krasovsky/immich that referenced this pull request Jun 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants