I have the option to do the following, run one query 1000 times with a limit of 1, or the same query with a limit of 1000 once.
Is there a significant performance difference in the two?
Some context: The results of a query is used for a larger XML operation that can take up to a few seconds to complete, so what I am currently doing is using a Javascript loop with AJAX to get one element at a time and display them as the query goes along and finishes its work, giving the appearance of a faster website then what it really is. If I did one large query it could take a minute before the page loads at all (if not using javascript but just pure PHP)
I am just wanting to see if the "faster" page is worth the potential extra server load or if its better to just have users wait for a while (something that I would feel bad about)