Skip to content

Commit f377a57

Browse files
Merge pull request #27 from AlexicaWright/add-indexes-constraints
Add indexes constraints
2 parents 99b485e + 1adb535 commit f377a57

File tree

8 files changed

+37
-5
lines changed

8 files changed

+37
-5
lines changed

modules/ROOT/content-nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
* xref:file-provision.adoc[]
55
* xref:modeling.adoc[]
66
* xref:mapping.adoc[]
7+
* xref:indexes-constraints.adoc[]
78
* xref:import.adoc[]
89
* xref:import-others.adoc[]

modules/ROOT/images/Group.png

498 KB
Loading
40.9 KB
Loading

modules/ROOT/images/di-ui.png

141 KB
Loading

modules/ROOT/pages/index.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This manual covers the following areas:
99
* xref:file-provision.adoc[File provision] -- How to provide files for import.
1010
* xref:modeling.adoc[Modeling] -- Guidelines to model your data.
1111
* xref:mapping.adoc[Mapping] -- How to map your data to the model.
12+
* xref:indexes-constraints.adoc[Indexes and constraints] -- Optimize query performance.
1213
* xref:import.adoc[Import] -- Preview and import your data.
1314
* xref:import-others.adoc[Other options for data import] -- Other ways to import data.
1415
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
:description: This section describes how to use indexes and constraints in Data Importer
2+
= Indexes and constraints
3+
4+
Data Importer supports adding indexes to improve read performance of queries and creates constraints to ensure the accuracy of data.
5+
They are found in the details panel and the tab is visible when a single node is selected in the data model panel.
6+
7+
image::constraints-tab.png[]
8+
9+
Once a node is mapped to a file and a property is selected to serve as its ID, both a constraint and an index are created automatically.
10+
11+
== Constraints
12+
13+
A uniqueness constraint is created on the node property selected as node ID.
14+
This ensures that no other node with the same ID is created and to achieve that, a corresponding index is also created to support that constraint.
15+
It is not possible to modify the uniqueness constraint nor to add any additional constraints.
16+
For more information on constraints see link:https://neo4j.com/docs/cypher-manual/current/constraints/#unique-node-property[Cypher Manual -> Constraints].
17+
18+
== Indexes
19+
20+
As mentioned previously, an index is created automatically on the assigned ID property for a node to support the uniqueness constraint.
21+
This index cannot be modified in any way from this tab, but if you change which property to use as ID, both the constraint and corresponding index change accordingly.
22+
23+
You can add more indexes with the `+` and then select which property to index from the dropdown menu.
24+
If you know that you will regularly look at a specific property, it is good practice to add an index to that property.
25+
For example in the Northwind dataset, if you know you are going to be looking for orders in a specific date range, it is advisable to add an index to the `orderDate` property.
26+
27+
Regardless of which property you add the index to, the index type is Neo4j's default index, which is `range` for Neo4j 5 and `btree` for Neo4j 4.x.
28+
For more information on indexes, see link:https://neo4j.com/docs/cypher-manual/current/indexes/[Cypher Manual -> Indexes].
29+
30+

modules/ROOT/pages/mapping.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Affected elements already imported are updated and **not** duplicated.
1414

1515
== Nodes
1616

17-
To map a node to a file, the node needs to have a label, which you can type directly on the node or in the mapping detals panel.
17+
To map a node to a file, the node needs to have a label, which you can type directly on the node or in the mapping details panel.
1818
After naming the label, you can select the file to map to the node.
1919
Adding the file can be done at any time before running the import, but it is convenient to do it at this stage.
2020

modules/ROOT/pages/overview.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ See xref:import.adoc#run-import[Run the import] for more information about the c
3737
The `...` menu contains options to open a saved model, with or without data, to save your current model, with or without data, settings for the import, and an option to clear everything.
3838
For more information on the settings, see xref:mapping.adoc#exclude-list[Node exclude list].
3939

40-
4140
== Details panel
4241

43-
Every element in the data model is mapped in this section.
44-
This is where you give labels to nodes and relationships, map them to files from the files panel, and specify their properties.
42+
The details panel contains two tabs, _Definition_ and _Constraints & Indexes_.
43+
The _Defintion_ tab is where you give labels to nodes and relationships, map them to files from the files panel, and specify their properties.
4544
See xref:mapping.adoc[] for more information.
46-
45+
The _Constraints & Indexes_ tab allows you to see details about constraints and indexes and lets you add or modify the latter.
46+
See xref:indexes-constraints.adoc[] for more information.

0 commit comments

Comments
 (0)