Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
412 views
in Plugins by
edited

After checking at the source code of sitemap plugin, I found this:

SELECT postid, title, hotness FROM ^posts WHERE postid>=? AND type='Q' ORDER BY postid LIMIT 100

Why limit 100? What the heaven?!

1 Answer

+2 votes
by
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.
...