Databases Reference
In-Depth Information
8
Indexing and Ordering Data Sets
WHAT'S IN THIS CHAPTER?
Creating indexes that help enhance query performance
Creating and maintaining indexes in document databases and
column-family databases
Ordering NoSQL data sets
Making eff ective design choices to create optimal indexes and
ordering patterns
You have already learned the essentials of querying NoSQL databases. In this chapter, you
take the next step to ensure that your queries are fast and effi cient. In relational databases, a
common way to optimize query performance is to leverage database indexes. Similar concepts
apply to the world of NoSQL as well.
Indexes exist to increase data access performance. In theory, they are similar in behavior to
the index in a book. When you need to search for a term or a word in a book, you have two
options, namely:
Scan the entire book page by page to search for the term or word.
Look up the index at the end to fi nd the pages where the term or word can be found
and then browse to those specifi c pages.
Between these two options it's a no-brainer to look up the index as opposed to a page-by-page
scan to fi nd the term. It makes the job easy and saves time.
In an analogous manner you have two choices when accessing a record in a database:
Look through the entire collection or data set item by item.
Leverage the index to get to the relevant data quickly.
Search WWH ::




Custom Search