Optimize AR import query