Package org.h2.table
Class IndexHints
- java.lang.Object
-
- org.h2.table.IndexHints
-
public final class IndexHints extends java.lang.Object
Contains the hints for which index to use for a specific table. Currently allows a list of "use indexes" to be specified.Use the factory method IndexHints.createUseIndexHints(listOfIndexes) to limit the query planner to only use specific indexes when determining which index to use for a table
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.LinkedHashSet<java.lang.String>
allowedIndexes
-
Constructor Summary
Constructors Modifier Constructor Description private
IndexHints(java.util.LinkedHashSet<java.lang.String> allowedIndexes)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
allowIndex(Index index)
Allow an index to be used.static IndexHints
createUseIndexHints(java.util.LinkedHashSet<java.lang.String> allowedIndexes)
Create an index hint object.java.util.Set<java.lang.String>
getAllowedIndexes()
java.lang.String
toString()
-
-
-
Method Detail
-
createUseIndexHints
public static IndexHints createUseIndexHints(java.util.LinkedHashSet<java.lang.String> allowedIndexes)
Create an index hint object.- Parameters:
allowedIndexes
- the set of allowed indexes- Returns:
- the hint object
-
getAllowedIndexes
public java.util.Set<java.lang.String> getAllowedIndexes()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
allowIndex
public boolean allowIndex(Index index)
Allow an index to be used.- Parameters:
index
- the index- Returns:
- whether it was already allowed
-
-