Skip to content

Commit eb03755

Browse files
committed
IndexType JavaDocs
1 parent 415220c commit eb03755

File tree

1 file changed

+29
-1
lines changed
  • objectbox-java-api/src/main/java/io/objectbox/annotation

1 file changed

+29
-1
lines changed

objectbox-java-api/src/main/java/io/objectbox/annotation/IndexType.java

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,34 @@
1616

1717
package io.objectbox.annotation;
1818

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+
*/
1924
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
2149
}

0 commit comments

Comments
 (0)