Splitting up queries for migration to labs