Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Speed up uniqueness verification for numeric indexes
Uniqueness verification turned out to be very slow for numeric indexes after migration to Lucene 5. This was caused by numeric field format change from string to double. So previously ValueEncoding.Number created a StringField but now it creates a DoubleField. Lucene stores each numeric field as a trie of terms representing parts of the numeric value. This means that when we iterate over terms to verify uniqueness we can see many more terms than actual inserted values. Non-leaf terms of such tries are reused for many inserted numeric values and thus have very high document frequency. This forced uniqueness verification to launch many duplicate checking queries for these 'special' terms and it was slow. This commit adds filtering of Lucene internal numeric terms so that verification needs to iterate only by real property values and does not need to excessively query the index. It also extracts the inner ValueEncoding enum to be a top level enum. co-author: @MishaDemianenko
- Loading branch information
Showing
6 changed files
with
334 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.