Chapter 9. Performance considerations
This chapter covers
- Optimizing the indexing process and the index structure
- Optimizing queries
- Index partitioning (named sharding)
- Testing
While full-text search technology, also called information retrieval, offers many features not attainable by a pure relational database, it’s also well known for retrieving information quickly. People are accustomed to retrieving search results in fractions of a second and grow impatient if it doesn’t happen that fast. Blame Google!
This chapter is a collection of information, tips, and tricks for making the best of your Hibernate Search application and understanding why some operations are expensive. You have some of this knowledge already if you’ve read the previous chapters carefully; some of it will be new to you. The authors thought it would be quite convenient to collect all of these techniques into a single chapter.
Performance is always a double-edged sword problem. As Donald Knuth (the author of The Art of Computer Programming) phrased it: Premature optimization is the root of all evil.
Before running into optimization cycles and before applying every single trick in this chapter, you should be very clear about what your goals are. Ask yourself:
- Is the application fast enough already?
- If it’s slow, which use case should be made more efficient?
- Is the cost of this optimization worth the gain?