Ask a Question
Advertise on boostr.in
how to repair a corrupted mptt tree nested set in the database using sql using -'sql,mysql,nested-sets,mptt'
how to repair a corrupted mptt tree nested set in the database using sql ¬†using -'sql,mysql,nested-sets,mptt'
I have an MPTT tree of over 100,000 records stored in MySQL using lft, rght and parent_id columns. Now the left/right values became corrupted, while the parent ids are still intact. It would require tons of queries to repair it in the application layer. Is there a good way to put the burden on the database and have it recalculate the left/right values using only SQL?
Just to clarify, I need to recalculate the numeric lft/rght values of a nested set, not the ids of neighboring records.
Sep 7, 2015
to add a comment.
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
To avoid this verification in future, please