It doesn’t. That would be way too much calculation to perform in such a short time.
Instead what Google does is use an “index” which they constructed in advance. Think about an index in a book; instead of looking up all instances of the word “rutabaga” for example by searching through every page, they looked through every page in advance and just listed down their page numbers. It saves a lot of time when someone wants to know wherever rutabagas were mentioned. Google can make this massive index in advance and then construct the response to an arbitrary search query simply by referencing that index which can all be kept in massive amounts of active memory making it blindingly fast.
Another trick is that Google used to say it “found 30 million matches in 0.15 seconds” or whatever. Their systems might say there are that many possible returns but they only actually *show* you the one page of links at a time. So if they look at the entry for rutabaga and it says there are 30 million mentions and you just read off the first ten page numbers it might *seem* really impressive to say you found 30 million matches in that time period.
Latest Answers