Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How Google and other websites search faster

 
Piyush Garg
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How Google and other search engines search faster ,
i try a database containing 75000 records that takes a long time to find
Is there any method for
send the code snippet or algorithm or concept
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't claim to know anything about how Google builds its search collections - but I do know that one of the keys to its speed is it uses the world's larges Linux cluster.

The normal route to speed up queries is to add indexes to the fields you search on. Of course your query could just be poorly written - if you post more details perhaps people will provide critique.
 
Loren Rosen
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course the other, less common thing to make queries faster is to add parallelism, and it's likely Google is doing that too.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34410
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Piyush,
Welcome to JavaRanch!

A query for a few rows in 75000 should take less than a second. An index would really help you out here. I've done queries on millions of records without noticeable performance.

It also depends how many records you need to match in the result. A query for 10 rows in a 100 million records (with a proper index) is going to be much faster than a query for 10,000 records out of a million. The less rows the query has to return, the less disk accesses it needs to make. In addition to the things already mentioned, this is something that works in Google's favor. They only need to return one page of results at a time. If you do a query and page through the results, you'll notice that the total number of rows gets more refined over time. The initial "page 1 of 20" is an estimate.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic