[!--quoteo(post=373332:date=May 12 2006, 02:53 PM:name=jbreits)--][div class=\'quotetop\']QUOTE(jbreits @ May 12 2006, 02:53 PM) [snapback]373332[/snapback][/div][div class=\'quotemain\'][!--quotec--] Would it be faster to run the complete query once, and cache the results to a file of some sort? Then when loading the next page, the results are read from the file? Perhaps, you could even cache 1 file per page so no-in file processing has to be done. Does this sound like a more efficient method?[/quote] YES. This is easily the most efficient way to do this if you expect high traffic or the count(*) is on a table with a lot of rows. Counts are pretty slow as sql queries go, so if you put the count(*) into a cron (you can decide how often, depending on how often the number actually changes and how it would effect your page count) OR you can have the count update when a new item is added - assuming that happens less than it's looked at. I cache stuff like that into a small MyISAM table in MySQL, and on larger (>1000) row tables, you'll see an improvement immediately. You can certainly cache to a file if you wish, but there's no need to. You know that pagecount table will only get selects except for say once an hour on cron - so you dont' have to worry about locks or anything.