Baron Schwartz at MySQLPerformanceBlog.com authored a post about this. I wish there was a magic bullet for this problem, but there isn't. Summary of the options he presented:
- On the first query, fetch and cache all the results.
- Don't show all results.
- Don't show the total count or the intermediate links to other pages. Show only the "next" link.
- Estimate how many results there are.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…