Query limiting, loop and progress bar.