GeezerVison is showing github.com — IndexType JavaDocs · haojiexuexi/objectbox-java@eb03755
File tree
Expand file treeCollapse file tree
Open diff view settings
objectbox-java-api/src/main/java/io/objectbox/annotation
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: objectbox-java-api/src/main/java/io/objectbox/annotation/IndexType.java +29-1Lines changed: 29 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
16 | 16 |
|
17 | 17 | package io.objectbox.annotation; |
18 | 18 |
|
| 19 | +/** |
| 20 | + * ObjectBox offers three index types, from which it chooses from with a reasonable default (see {@link #DEFAULT}). |
| 21 | + * <p> |
| 22 | + * For some queries/use cases it might make sense to override the default choice for optimization purposes. |
| 23 | + */ |
19 | 24 | public enum IndexType { |
20 | | - DEFAULT, VALUE, HASH, HASH64 |
| 25 | + /** |
| 26 | + * Use the default index type depending on the property type: |
| 27 | + * {@link #VALUE} for scalars and {@link #HASH} for Strings and byte arrays. |
| 28 | + */ |
| 29 | + DEFAULT, |
| 30 | + |
| 31 | + /** |
| 32 | + * Use the property value to build the index. |
| 33 | + * For Strings and byte arrays this may occupy more space than the default setting. |
| 34 | + */ |
| 35 | + VALUE, |
| 36 | + |
| 37 | + /** |
| 38 | + * Use a (fast non-cryptographic) hash of the property value to build the index. |
| 39 | + * Internally, it uses a 32 bit hash with a decent hash collision behavior. |
| 40 | + * Because occasional collisions do not really impact performance, this is usually a better choice than |
| 41 | + * {@link #HASH64} as it takes less space. |
| 42 | + */ |
| 43 | + HASH, |
| 44 | + |
| 45 | + /** |
| 46 | + * Use a long (fast non-cryptographic) hash of the property value to build the index. |
| 47 | + */ |
| 48 | + HASH64 |
21 | 49 | } |