title: SQL query to search faster or using hash table
body: <p>If I am looking for a record in the database, is writing a sql query to search the database directly faster OR is reading the entire data from the database into a hashtable and then searching in O(1) time faster?
  This question is for experienced programmers who have faced such issues in the past. </p>