Improve SQL upgrade speed