MariaDB/MySQL traditionally have performance issues for queries of type UPDATE ... WHERE xxx IN (SELECT ...) Instead, use JOINs which are much faster. Signed-off-by: Simon Rettberg <simon.rettberg@rz.uni-freiburg.de>