Optimizes select statement for RealURL lookup