4 Working with indexes
This chapter covers:
- Auto-indexes and their lifecycle
- Intervening in management of auto-indexes
- Manual index creation and management
- Advanced field options of indexes
Indexes play an important role in RavenDB. This is the part of RavenDB that allows it to answer user queries; without indexes RavenDB is just a simple key/value store. By offering fine-grained control over indexes and advanced features like automatically creating and managing them when possible, RavenDB shines as a document database.
In the previous chapter you learned about Simple Map indexes that index document properties and enable querying on them and also how Map/Reduce indexes can help with aggregation operations on that data. We discussed the index structure and mentioned several times how important indexes are to the querying process. What we haven’t discussed yet is when indexes are created and how.
To ease the process of development RavenDB uses auto-indexes, which relieves you of the burden of declaring indexes upfront manually. Automatic management of indexes is part of RavenDB’s auto-tuning feature, which enables you—the developer—to focus on what matters most and leave the technicalities to the database itself.