Improve SQL table lookup performance