Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Indexes chapter #770

Merged
merged 34 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d80530c
more trial resturcture
JPryce-Aklundh Oct 10, 2023
47ff759
update
JPryce-Aklundh Oct 26, 2023
a742899
merge dev
JPryce-Aklundh Oct 26, 2023
a034b83
add supported predicates tables
JPryce-Aklundh Oct 26, 2023
7e1f672
update to fulltext
JPryce-Aklundh Oct 30, 2023
c2cafeb
add image to fulltext and change graph example
JPryce-Aklundh Oct 31, 2023
bdac684
more changes to fulltext
JPryce-Aklundh Nov 1, 2023
a9a467d
Merge branch 'dev' into indexes
JPryce-Aklundh Nov 1, 2023
cd534a0
fix fulltext query
JPryce-Aklundh Nov 1, 2023
1f42da7
post review corrections 1
JPryce-Aklundh Nov 2, 2023
d794ad8
post review corrections 2 and more info on analyzers
JPryce-Aklundh Nov 3, 2023
86e8123
fix broken query
JPryce-Aklundh Nov 3, 2023
b9d4dbc
structural update
JPryce-Aklundh Nov 28, 2023
7839f70
more updates
JPryce-Aklundh Dec 11, 2023
4e13e4d
more updates
JPryce-Aklundh Dec 15, 2023
9d817a8
update for PR 810 (allow params in create and drop indexes)
JPryce-Aklundh Dec 18, 2023
9ee1a31
update syntax page
JPryce-Aklundh Dec 18, 2023
5c27260
start on using indexes page
JPryce-Aklundh Dec 18, 2023
3ea471f
add using indexes page
JPryce-Aklundh Dec 19, 2023
0f5bcdb
merge
JPryce-Aklundh Dec 19, 2023
abcdf64
fix xref
JPryce-Aklundh Dec 19, 2023
f38e637
Merge branch 'indexes2' into indexes
JPryce-Aklundh Dec 19, 2023
6b73e5b
editorial fixes
JPryce-Aklundh Dec 20, 2023
9eefb7c
restructure and rename adoc files
JPryce-Aklundh Jan 2, 2024
ed00012
add PR 805
JPryce-Aklundh Jan 2, 2024
980411c
add PR 824
JPryce-Aklundh Jan 3, 2024
f6c832f
add new composite index rules section
JPryce-Aklundh Jan 4, 2024
04923c3
large update including indexes and null values
JPryce-Aklundh Jan 9, 2024
5f749cb
final structural change - remove old using indexes and index hints pa…
JPryce-Aklundh Jan 9, 2024
34d9ecb
fix conflict
JPryce-Aklundh Jan 9, 2024
b4cadaf
Merge branch 'indexes3' into indexes
JPryce-Aklundh Jan 9, 2024
7d17e4b
fix links to index hints page
JPryce-Aklundh Jan 9, 2024
3b28307
minor fixes
JPryce-Aklundh Jan 9, 2024
d25ba6d
post-review update
JPryce-Aklundh Jan 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions modules/ROOT/content-nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,15 @@
** xref:functions/database.adoc[]
** xref:functions/user-defined.adoc[]

* xref:indexes-for-search-performance.adoc[]
* xref:indexes-for-full-text-search.adoc[]
* xref:indexes-for-vector-search.adoc[]
* xref:indexes/index.adoc[]
** xref:indexes/search-performance-indexes/overview.adoc[]
*** xref:indexes/search-performance-indexes/managing-indexes.adoc[]
*** xref:indexes/search-performance-indexes/using-indexes.adoc[]
*** xref:indexes/search-performance-indexes/index-hints.adoc[]
** xref:indexes/semantic-indexes/overview.adoc[]
*** xref:indexes/semantic-indexes/full-text-indexes.adoc[]
*** xref:indexes/semantic-indexes/vector-indexes.adoc[]
** xref:indexes/syntax.adoc[]

* xref:constraints/index.adoc[]
** xref:constraints/syntax.adoc[]
Expand All @@ -91,10 +97,8 @@
** xref:planning-and-tuning/runtimes/index.adoc[]
*** xref:planning-and-tuning/runtimes/concepts.adoc[Concepts]
*** xref:planning-and-tuning/runtimes/reference.adoc[]
** xref:planning-and-tuning/query-tuning/index.adoc[]
*** xref:planning-and-tuning/query-tuning/indexes.adoc[]
*** xref:planning-and-tuning/query-tuning/using.adoc[]
*** xref:planning-and-tuning/query-tuning/query-options.adoc[]
** xref:planning-and-tuning/query-tuning.adoc[]


* xref:query-caches/index.adoc[]
** xref:query-caches/unified-query-caches.adoc[]
Expand Down
1 change: 1 addition & 0 deletions modules/ROOT/images/full_text_graph.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions modules/ROOT/images/using_indexes_example_graph.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
This page describes advanced query optimizations based on native index capabilities.

One of the most important and useful ways of optimizing Cypher queries involves creating appropriate indexes.
This is described in more detail in xref::indexes-for-search-performance.adoc[], and demonstrated in xref::appendix/tutorials/basic-query-tuning.adoc[].
This is described in more detail in xref:indexes/search-performance-indexes/managing-indexes.adoc[], and demonstrated in xref::appendix/tutorials/basic-query-tuning.adoc[].
In summary, an index will be based on the combination of a `Label` and a `property`.
Any Cypher query that searches for nodes with a specific label and some predicate on the property (equality, range or existence) will be planned to use
the index if the cost planner deems that to be the most efficient solution.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -764,5 +764,5 @@ Total database accesses: 5, total allocated memory: 184
1 row
----

Our execution plan is down to a single row and uses the xref::planning-and-tuning/operators/operators-detail.adoc#query-plan-node-index-seek[Node Index Seek] operator which does an index seek (see xref::indexes-for-search-performance.adoc[]) to find the appropriate node.
Our execution plan is down to a single row and uses the xref::planning-and-tuning/operators/operators-detail.adoc#query-plan-node-index-seek[Node Index Seek] operator which does an index seek (see xref::indexes/search-performance-indexes/managing-indexes.adoc[]) to find the appropriate node.

12 changes: 6 additions & 6 deletions modules/ROOT/pages/clauses/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -234,22 +234,22 @@ m| xref:clauses/transaction-clauses.adoc#query-terminate-transactions[TERMINATE
== Reading hints

These comprise clauses used to specify planner hints when tuning a query.
More details regarding the usage of these -- and query tuning in general -- can be found in xref::planning-and-tuning/query-tuning/using.adoc[Planner hints and the USING keyword].
More details regarding the usage of these -- and query tuning in general -- can be found in xref::indexes/search-performance-indexes/index-hints.adoc[Planner hints and the USING keyword].

[options="header"]
|===
| Hint | Description

m| xref::planning-and-tuning/query-tuning/using.adoc#query-using-index-hint[USING INDEX]
m| xref::indexes/search-performance-indexes/index-hints.adoc#query-using-index-hint[USING INDEX]
| Index hints are used to specify which index, if any, the planner should use as a starting point.

m| xref::planning-and-tuning/query-tuning/using.adoc#query-using-index-hint[USING INDEX SEEK]
m| xref::indexes/search-performance-indexes/index-hints.adoc#query-using-index-hint[USING INDEX SEEK]
| Index seek hint instructs the planner to use an index seek for this clause.

m| xref::planning-and-tuning/query-tuning/using.adoc#query-using-scan-hint[USING SCAN]
m| xref::indexes/search-performance-indexes/index-hints.adoc#query-using-scan-hint[USING SCAN]
| Scan hints are used to force the planner to do a label scan (followed by a filtering operation) instead of using an index.

m| xref::planning-and-tuning/query-tuning/using.adoc#query-using-join-hint[USING JOIN]
m| xref::indexes/search-performance-indexes/index-hints.adoc#query-using-join-hint[USING JOIN]
| Join hints are used to enforce a join operation at specified points.

|===
Expand All @@ -263,7 +263,7 @@ These comprise clauses to create, show, and drop indexes and constraints.
|===
| Clause | Description

m| xref::indexes-for-search-performance.adoc#indexes-syntax[CREATE \| SHOW \| DROP INDEX]
m| xref:indexes/search-performance-indexes/managing-indexes.adoc#indexes-syntax[CREATE \| SHOW \| DROP INDEX]
| Create, show or drop an index.

m| xref::constraints/syntax.adoc[CREATE \| SHOW \| DROP CONSTRAINT]
Expand Down
2 changes: 1 addition & 1 deletion modules/ROOT/pages/clauses/match.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Cypher is declarative, and so usually the query itself does not specify the algo
Neo4j will automatically work out the best approach to finding start nodes and matching patterns.
Predicates in `WHERE` parts can be evaluated before pattern matching, during pattern matching, or after finding matches.
However, there are cases where you can influence the decisions taken by the query compiler.
Read more about indexes in xref::indexes-for-search-performance.adoc[], and more about specifying hints to force Neo4j to solve a query in a specific way in xref::planning-and-tuning/query-tuning/using.adoc[Planner hints and the USING keyword].
Read more about indexes in xref:indexes/search-performance-indexes/managing-indexes.adoc[], and more about specifying hints to force Neo4j to solve a query in a specific way in xref::indexes/search-performance-indexes/index-hints.adoc[Planner hints and the USING keyword].


[[match-example-graph]]
Expand Down
2 changes: 1 addition & 1 deletion modules/ROOT/pages/clauses/merge.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ If there isn't a node with the specific `name` property, a new node will be crea
[NOTE]
====
For performance reasons, creating a schema index on the label or property is highly recommended when using `MERGE`.
See xref::indexes-for-search-performance.adoc[] for more information.
See xref:indexes/search-performance-indexes/managing-indexes.adoc[] for more information.
====

When using `MERGE` on full patterns, the behavior is that either the whole pattern matches, or the whole pattern is created.
Expand Down
2 changes: 1 addition & 1 deletion modules/ROOT/pages/clauses/transaction-clauses.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ m| MAP
m| planner
a|
The name of the Cypher planner used to plan the query currently executing in this transaction, or an empty string if no query is currently executing.
For details, see xref::planning-and-tuning/query-tuning/index.adoc#cypher-planner[Cypher planner].
For details, see xref::planning-and-tuning/query-tuning.adoc#cypher-planner[Cypher planner].
m| STRING

m| runtime
Expand Down
2 changes: 1 addition & 1 deletion modules/ROOT/pages/clauses/where.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ In the case of `WITH`, however, `WHERE` simply filters the results.
In the case of multiple `MATCH` / `OPTIONAL MATCH` clauses, the predicate in `WHERE` is always a part of the patterns in the directly preceding `MATCH` / `OPTIONAL MATCH`.
Both results and performance may be impacted if `WHERE` is put inside the wrong `MATCH` clause.

xref::indexes-for-search-performance.adoc[Indexes] may be used to optimize queries using `WHERE` in a variety of cases.
xref:indexes/search-performance-indexes/managing-indexes.adoc[Indexes] may be used to optimize queries using `WHERE` in a variety of cases.

[[where-example-graph]]
== Example graph
Expand Down
8 changes: 4 additions & 4 deletions modules/ROOT/pages/constraints/examples.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ CREATE CONSTRAINT book_title FOR (book:Book) REQUIRE book.title IS UNIQUE
----

In this case, the constraint cannot be created because it is in conflict with the existing graph.
Either use xref::indexes-for-search-performance.adoc[] instead, or remove/correct the offending nodes and then re-apply the constraint.
Either use xref:indexes/search-performance-indexes/managing-indexes.adoc[] instead, or remove/correct the offending nodes and then re-apply the constraint.

.Error message
[source, error]
Expand Down Expand Up @@ -672,7 +672,7 @@ CREATE CONSTRAINT series_title FOR ()-[sequel:SEQUEL_OF]-() REQUIRE (sequel.seri
----

In this case, the constraint cannot be created because it is in conflict with the existing graph.
Either use xref::indexes-for-search-performance.adoc[] instead, or remove/correct the offending relationships and then re-apply the constraint.
Either use xref:indexes/search-performance-indexes/managing-indexes.adoc[] instead, or remove/correct the offending relationships and then re-apply the constraint.

.Error message
[source, error]
Expand Down Expand Up @@ -2368,7 +2368,7 @@ CREATE CONSTRAINT actor_born FOR (actor:Actor) REQUIRE (actor.born) IS NODE KEY
----

In this case, the node key constraint cannot be created because it is in conflict with the existing graph.
Either use xref::indexes-for-search-performance.adoc[] instead, or remove/correct the offending nodes and then re-apply the constraint.
Either use xref:indexes/search-performance-indexes/managing-indexes.adoc[] instead, or remove/correct the offending nodes and then re-apply the constraint.

.Error message
[source, error]
Expand Down Expand Up @@ -2729,7 +2729,7 @@ CREATE CONSTRAINT knows_level FOR ()-[knows:KNOWS]-() REQUIRE (knows.level) IS R
----

In this case, the relationship key constraint cannot be created because it is in conflict with the existing graph.
Either use xref::indexes-for-search-performance.adoc[] instead, or remove or correct the offending relationships and then re-apply the constraint.
Either use xref:indexes/search-performance-indexes/managing-indexes.adoc[] instead, or remove or correct the offending relationships and then re-apply the constraint.

.Error message
[source, error]
Expand Down
2 changes: 1 addition & 1 deletion modules/ROOT/pages/constraints/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Creating a constraint has the following implications on indexes:
* Adding a node key, relationship key, or property uniqueness constraint on a single property also adds an index on that property, and therefore, an index of the same index type, label/relationship type, and property combination cannot be added separately.
* Adding a node key, relationship key, or property uniqueness constraint for a set of properties also adds an index on those properties, and therefore, an index of the same index type, label/relationship type, and properties combination cannot be added separately.
* Cypher will use these indexes for lookups just like other indexes.
Refer to xref::indexes-for-search-performance.adoc[] for more details on indexes.
Refer to xref:indexes/search-performance-indexes/managing-indexes.adoc[] for more details on indexes.
* If a node key, relationship key, or property uniqueness constraint is dropped and the backing index is still required, the index need to be created explicitly.

Additionally, the following is true for constraints:
Expand Down
Loading