Package org.h2.table

Class IndexHints

java.lang.Object
org.h2.table.IndexHints

public final class IndexHints extends 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 Details

  • Constructor Details

  • Method Details

    • createUseIndexHints

      public static IndexHints createUseIndexHints(LinkedHashSet<String> allowedIndexes)
      Create an index hint object.
      Parameters:
      allowedIndexes - the set of allowed indexes
      Returns:
      the hint object
    • getAllowedIndexes

      public Set<String> getAllowedIndexes()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • allowIndex

      public boolean allowIndex(Index index)
      Allow an index to be used.
      Parameters:
      index - the index
      Returns:
      whether it was already allowed