Interface ExposesHints

All Known Subinterfaces:
ExposesSubqueryCall.BuildableSubquery, StatementBuilder.OngoingReadingWithoutWhere

@API(status=STABLE, since="2021.0.0") public interface ExposesHints
A step exposing a several using methods that are provide entry points of adding advanced query hints. Read more about that topic here: Planner hints and the USING keyword. Note that those hints are specific to Neo4j and not part of openCypher.
Since:
2021.0.0
Author:
Michael J. Simons
  • Method Details

    • usingIndex

      Applies an INDEX hint for one or more properties.

      Index hints are used to specify which index, if any, the planner should use as a starting point. This can be beneficial in cases where the index statistics are not accurate for the specific values that the query at hand is known to use, which would result in the planner picking a non-optimal index.

      Read more about SCAN hints here.

      Parameters:
      properties - One or properties that makes up the index. The properties must belong to the same node.
      Returns:
      A statement using an INDEX hint.
    • usingIndexSeek

      Applies an INDEX SEEL hint for one or more properties.

      Index hints are used to specify which index, if any, the planner should use as a starting point. This can be beneficial in cases where the index statistics are not accurate for the specific values that the query at hand is known to use, which would result in the planner picking a non-optimal index.

      Read more about SCAN hints here.

      Parameters:
      properties - One or properties that makes up the index. The properties must belong to the same node.
      Returns:
      A statement using an INDEX SEEK hint.
    • usingScan

      Applies a SCAN hint on a node.

      If your query matches large parts of an index, it might be faster to scan the label and filter out nodes that do not match.

      Read more about SCAN hints here.

      Parameters:
      node - The node that should be scanned
      Returns:
      A statement using a SCAN hint.
    • usingJoinOn

      @NotNull @CheckReturnValue default StatementBuilder.OngoingReadingWithoutWhere usingJoinOn(Node... nodes)
      Applies a JOIN hint on one or more nodes.

      Join hints are the most advanced type of hints, and are not used to find starting points for the query execution plan, but to enforce that joins are made at specified points. This implies that there has to be more than one starting point (leaf) in the plan, in order for the query to be able to join the two branches ascending from these leaves.

      Read more about JOIN hints here.

      Parameters:
      nodes - The nodes on which a join should be started.
      Returns:
      A statement using a JOIN hint.
    • usingJoinOn

      Applies a JOIN hint on one or more nodes identified by their names.

      Join hints are the most advanced type of hints, and are not used to find starting points for the query execution plan, but to enforce that joins are made at specified points. This implies that there has to be more than one starting point (leaf) in the plan, in order for the query to be able to join the two branches ascending from these leaves.

      Read more about JOIN hints here.

      Parameters:
      names - The symbolic names identifying the nodes.
      Returns:
      A statement using a JOIN hint.