forked from neo4j/neo4j-go-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
summary_plan.go
64 lines (57 loc) · 2.5 KB
/
summary_plan.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* Copyright (c) 2002-2019 "Neo4j,"
* Neo4j Sweden AB [http://neo4j.com]
*
* This file is part of Neo4j.
*
* 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 neo4j
// Plan describes the actual plan that the database planner produced and used (or will use) to execute your statement.
// This can be extremely helpful in understanding what a statement is doing, and how to optimize it. For more details,
// see the Neo4j Manual. The plan for the statement is a tree of plans - each sub-tree containing zero or more child
// plans. The statement starts with the root plan. Each sub-plan is of a specific operator, 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.
type Plan interface {
// Operator returns the operation this plan is performing.
Operator() string
// Arguments returns the arguments for the operator used.
// Many operators have arguments defining their specific behavior. This map contains those arguments.
Arguments() map[string]interface{}
// Identifiers returns a list of identifiers used by this plan. Identifiers used by this part of the plan.
// These can be both identifiers introduced by you, or automatically generated.
Identifiers() []string
// Children returns zero or more child plans. 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 operator that
// introduces new records on its own.
Children() []Plan
}
type neoPlan struct {
operator string
arguments map[string]interface{}
identifiers []string
children []Plan
}
func (plan *neoPlan) Operator() string {
return plan.operator
}
func (plan *neoPlan) Arguments() map[string]interface{} {
return plan.arguments
}
func (plan *neoPlan) Identifiers() []string {
return plan.identifiers
}
func (plan *neoPlan) Children() []Plan {
return plan.children
}