Improve SQL run time

Original text of this message