dongxia9620 2013-05-31 16:49
浏览 29
已采纳

使用下限或一次具有较大限制,服务器负载差异多次运行一个查询? [关闭]

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)

  • 写回答

2条回答 默认 最新

查看更多回答(1条)

报告相同问题?