This question already has an answer here:
I'm studying the differences between NoSQL and SQL. If I understood correctly, there are two main techniques to optimize a database:
Indexing rows. Say you wanted to make a query such as
WHERE x = 1 AND y = 2. Indexing the columns "x" and "y" together could drop the lookup from O(n) to O(1). This is the main technique used in SQL.
Constructing mapReduce relationships. Say you need to compute the sum of money from users. You could set a
mapReduce(get_money,sum)on your database and it would cache that sum automatically, dropping lookup from O(n) to O(1) and update of the cache from O(n) to O(log(n)) because of the nature of mapReduce. This also makes parallelizing easier. Also, this is exclusive to non-relational databases.
Are those statements correct? What other techniques are important?