diff --git a/modules/ROOT/content-nav.adoc b/modules/ROOT/content-nav.adoc index 1986b2a..bf0cd58 100644 --- a/modules/ROOT/content-nav.adoc +++ b/modules/ROOT/content-nav.adoc @@ -4,5 +4,6 @@ * xref:file-provision.adoc[] * xref:modeling.adoc[] * xref:mapping.adoc[] +* xref:indexes-constraints.adoc[] * xref:import.adoc[] * xref:import-others.adoc[] diff --git a/modules/ROOT/images/Group.png b/modules/ROOT/images/Group.png new file mode 100644 index 0000000..0e6374b Binary files /dev/null and b/modules/ROOT/images/Group.png differ diff --git a/modules/ROOT/images/constraints-tab.png b/modules/ROOT/images/constraints-tab.png new file mode 100644 index 0000000..138bfc9 Binary files /dev/null and b/modules/ROOT/images/constraints-tab.png differ diff --git a/modules/ROOT/images/di-ui.png b/modules/ROOT/images/di-ui.png index b456772..0e6374b 100644 Binary files a/modules/ROOT/images/di-ui.png and b/modules/ROOT/images/di-ui.png differ diff --git a/modules/ROOT/pages/index.adoc b/modules/ROOT/pages/index.adoc index 2f58e6a..a1406dd 100644 --- a/modules/ROOT/pages/index.adoc +++ b/modules/ROOT/pages/index.adoc @@ -9,6 +9,7 @@ This manual covers the following areas: * xref:file-provision.adoc[File provision] -- How to provide files for import. * xref:modeling.adoc[Modeling] -- Guidelines to model your data. * xref:mapping.adoc[Mapping] -- How to map your data to the model. +* xref:indexes-constraints.adoc[Indexes and constraints] -- Optimize query performance. * xref:import.adoc[Import] -- Preview and import your data. * xref:import-others.adoc[Other options for data import] -- Other ways to import data. diff --git a/modules/ROOT/pages/indexes-constraints.adoc b/modules/ROOT/pages/indexes-constraints.adoc new file mode 100644 index 0000000..3e27929 --- /dev/null +++ b/modules/ROOT/pages/indexes-constraints.adoc @@ -0,0 +1,30 @@ +:description: This section describes how to use indexes and constraints in Data Importer += Indexes and constraints + +Data Importer supports adding indexes to improve read performance of queries and creates constraints to ensure the accuracy of data. +They are found in the details panel and the tab is visible when a single node is selected in the data model panel. + +image::constraints-tab.png[] + +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. + +== Constraints + +A uniqueness constraint is created on the node property selected as node ID. +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. +It is not possible to modify the uniqueness constraint nor to add any additional constraints. +For more information on constraints see link:https://neo4j.com/docs/cypher-manual/current/constraints/#unique-node-property[Cypher Manual -> Constraints]. + +== Indexes + +As mentioned previously, an index is created automatically on the assigned ID property for a node to support the uniqueness constraint. +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. + +You can add more indexes with the `+` and then select which property to index from the dropdown menu. +If you know that you will regularly look at a specific property, it is good practice to add an index to that property. +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. + +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. +For more information on indexes, see link:https://neo4j.com/docs/cypher-manual/current/indexes/[Cypher Manual -> Indexes]. + + diff --git a/modules/ROOT/pages/mapping.adoc b/modules/ROOT/pages/mapping.adoc index acb0644..8d3f63f 100644 --- a/modules/ROOT/pages/mapping.adoc +++ b/modules/ROOT/pages/mapping.adoc @@ -14,7 +14,7 @@ Affected elements already imported are updated and **not** duplicated. == Nodes -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. +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. After naming the label, you can select the file to map to the node. Adding the file can be done at any time before running the import, but it is convenient to do it at this stage. diff --git a/modules/ROOT/pages/overview.adoc b/modules/ROOT/pages/overview.adoc index f05d80a..d674efb 100644 --- a/modules/ROOT/pages/overview.adoc +++ b/modules/ROOT/pages/overview.adoc @@ -37,10 +37,10 @@ See xref:import.adoc#run-import[Run the import] for more information about the c 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. For more information on the settings, see xref:mapping.adoc#exclude-list[Node exclude list]. - == Details panel -Every element in the data model is mapped in this section. -This is where you give labels to nodes and relationships, map them to files from the files panel, and specify their properties. +The details panel contains two tabs, _Definition_ and _Constraints & Indexes_. +The _Defintion_ tab is where you give labels to nodes and relationships, map them to files from the files panel, and specify their properties. See xref:mapping.adoc[] for more information. - +The _Constraints & Indexes_ tab allows you to see details about constraints and indexes and lets you add or modify the latter. +See xref:indexes-constraints.adoc[] for more information.