If you deploy nightly Mastodon releases or directly from the main branch, you may want to check https://github.com/mastodon/mastodon/pull/30203
We merged a migration yesterday and it is far too expensive to run on large servers, so we are rolling it back. If you already applied it, please check the link above to revert it before upgrading.
It is probably best to skip today's nightly build, if you did not deploy it yet.