database - How do large sites do pagination? -


how large sites handle pagination on search results nth page loads first? example, google, youtube, hulu, etc.

youtube:

sorry, youtube not serve more 1000 results query

so caches first 1k results in similar memcached blob.

hulu: limits 3000 results. cached well.

google: it's pure black magic. keep in mind uses lot of distributed computing (and not simple db lookup), , caches first n results query, , "html ready" results each result page, , intermediate results (see dynamic programming).

to summarize: first query page might take more time since can cause engine start db/distributed search, however, it's results (much more amount showed) kept while in fast cache serving page same query without stressing db again.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -