When upgrading our system from ACS Core 5.2 to 5.3beta, we encountered the following problem: The function that updates the tree_sortkey in file upgrade-5.2.0b2-5.2.0b3.sql was inusably slow, when applied to the huge number of entries in our cr_items table (> 350.000), which have a quite deep hierarchy. It had not come to an end, after having run for a whole night.
I'll post a patch to the bug tracker for the file that hopefully does the same work in some minutes.