Package org.neo4j.graphdb
Class QueryExecutionType
java.lang.Object
org.neo4j.graphdb.QueryExecutionType
Signifies how a query is executed, as well as what side effects and results could be expected from the query.
In Cypher there are three different modes of execution:
Instances of this class contain the required information to be able to tell these different execution modes apart. It also contains information about what effects the query could have, and whether it could yield any results, in form of theQueryType enum
.
Queries executed with the PROFILE
directive can have side effects and produce results in the same way as a
normally executed method. The difference being that the user has expressed an interest in seeing the plan used to
execute the query, and that this plan will (after execution completes) be annotated with
profiling information from the execution of the query.
Queries executed with the EXPLAIN
directive never have any side effects, nor do they ever yield any rows in
the results, the sole purpose of this mode of execution is to
get a description of the plan that would be executed
if/when the query is executed normally (or under PROFILE
).
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static enum
static enum
Signifies what type of query anQueryExecutionType
executes. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Signifies that the execution of the query could produce a result.boolean
Signifies that the execution of the query could perform changes to the data.boolean
Signifies that the execution of the query updates the schema.static QueryExecutionType
Get theQueryExecutionType
that signifies explaining the plan of a query of the supplied type.boolean
Signifies that the query was executed with theEXPLAIN
directive.boolean
Signifies whether results from this execution contains profiling information.static QueryExecutionType
Get theQueryExecutionType
that signifies profiled execution of a query of the supplied type.static QueryExecutionType
Get theQueryExecutionType
that signifies normal execution of a query of the supplied type.Get the type of query this execution refers to.boolean
Signifies whether the supplied query contained a directive that asked for a description of the execution plan.toString()
-
Method Details
-
query
Get theQueryExecutionType
that signifies normal execution of a query of the supplied type.- Parameters:
type
- the type of query executed.- Returns:
- The instance that signifies normal execution of the supplied
QueryExecutionType.QueryType
.
-
profiled
Get theQueryExecutionType
that signifies profiled execution of a query of the supplied type.- Parameters:
type
- the type of query executed.- Returns:
- The instance that signifies profiled execution of the supplied
QueryExecutionType.QueryType
.
-
explained
Get theQueryExecutionType
that signifies explaining the plan of a query of the supplied type.- Parameters:
type
- the type of query executed.- Returns:
- The instance that signifies explaining the plan of the supplied
QueryExecutionType.QueryType
.
-
queryType
Get the type of query this execution refers to.- Returns:
- the type of query this execution refers to.
-
isProfiled
public boolean isProfiled()Signifies whether results from this execution contains profiling information. This istrue
for queries executed with thePROFILE
directive.- Returns:
true
if the results from this execution would contain profiling information.
-
requestedExecutionPlanDescription
public boolean requestedExecutionPlanDescription()Signifies whether the supplied query contained a directive that asked for a description of the execution plan. This istrue
for queries executed with either theEXPLAIN
orPROFILE
directives.- Returns:
true
if a description of the plan should be presented to the user.
-
isExplained
public boolean isExplained()Signifies that the query was executed with theEXPLAIN
directive.- Returns:
true
if the query was executed using theEXPLAIN
directive.
-
canContainResults
public boolean canContainResults()Signifies that the execution of the query could produce a result. This is an important distinction from the result being empty.- Returns:
true
if the execution would yield rows in the result set.
-
canUpdateData
public boolean canUpdateData()Signifies that the execution of the query could perform changes to the data.Result
.getQueryStatistics()
.containsUpdates()
signifies whether the query actually performed any updates.- Returns:
true
if the execution could perform changes to data.
-
canUpdateSchema
public boolean canUpdateSchema()Signifies that the execution of the query updates the schema.- Returns:
true
if the execution updates the schema.
-
toString
-