Tunnel vision is rarely helpful when reviewing code. If you zoom out a little you'll notice that the query is nested in a loop that keeps setting the minimum ID for the next iteration to the highest ID returned by the current one plus 1, until the query returns no further posts.
In other words, the code does not read just 100 records. It reads all of the records in the table qa_posts in chunks of 100.