I found out that ALTER TABLE statements on MySQL/MariaDB can be very, very slow when the query is executed on very large tables with many indices. The post-user table (that's the one that is responsible for the long running update) is huge. The table has a size of 140 GB and has 36 indices.