Imagine this:
You have a mysql table with 1 million rows, each row is a forum post from a thread with 1 million posts.
How do you find the page where that post is without counting all previous rows before the post...which would take several minutes/hours to complete as the rows are so many.
i assume the formula is:
(all previous rows / rows per page)
example: 459000/20 = page 22950
"all previous rows" need always to be counted or there's another way? (dont forget that the "rows per page" setting may be different for each user)
If we also consider that may exist a list of threads each one requiring a specific page number to link to the post (example: search) then it would be months (dont forget instead 1 million, it could be 1 billion and so on)
lol did i say waiting hours? how silly me...the script will give execution time error way before that...
Last edited by nanimo; 02-27-2008 at 04:54 PM..
|