org.neo4j.driver.summary.Plan Maven / Gradle / Ivy
Show all versions of neo4j-java-driver Show documentation
/*
* Copyright (c) "Neo4j"
* Neo4j Sweden AB [https://neo4j.com]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.neo4j.driver.summary;
import java.util.List;
import java.util.Map;
import org.neo4j.driver.Value;
import org.neo4j.driver.util.Immutable;
/**
* This describes the plan that the database planner produced and used (or will use) to execute your query.
* This can be extremely helpful in understanding what a query is doing, and how to optimize it. For more
* details, see the Neo4j Manual.
*
* The plan for the query is a tree of plans - each subtree containing zero or more child plans. The query
* starts with the root plan. Each sub-plan is of a specific {@link #operatorType() operator type}, which describes
* what that part of the plan does - for instance, perform an index lookup or filter results. The Neo4j Manual contains
* a reference of the available operator types, and these may differ across Neo4j versions.
*
* For a simple view of a plan, the {@code toString} method will give a human-readable rendering of the tree.
* @since 1.0
*/
@Immutable
public interface Plan {
/**
* @return the operation this plan is performing.
*/
String operatorType();
/**
* Many {@link #operatorType() operators} have arguments defining their specific behavior. This map contains
* those arguments.
*
* @return the arguments for the {@link #operatorType() operator} used.
*/
Map arguments();
/**
* Identifiers used by this part of the plan. These can be both identifiers introduce by you, or automatically
* generated identifiers.
* @return a list of identifiers used by this plan.
*/
List identifiers();
/**
* As noted in the class-level javadoc, a plan is a tree, where each child is another plan. The children are where
* this part of the plan gets its input records - unless this is an {@link #operatorType() operator} that introduces
* new records on its own.
* @return zero or more child plans.
*/
List extends Plan> children();
}