SQL limit cleanup