Database Reference
In-Depth Information
Using schema-level indexing
Neo4j 2.0 introduced indexes and constraints on labels which together define the schema
for Neo4j. Cypher CREATE constructs can be used to define constraints on the attributes
and indexes on labels. Creation of schema or defining schema is optional and can be de-
ferred until you want to provide structure to your data and focus is on performance.
Defining schema/index improves the speed of searching and is leveraged implicitly during
execution of the queries. Indexes are eventually available, that is, they are being populated
asynchronously without impacting the user operations. The decision of whether indexes
need to be used in a query will depend upon the state of the index. If an index is in the
available state, then it will be used, otherwise not. All these complexities of indexes are
hidden from developers and usually there is no need to specifically provide any hints in our
queries. There are APIs that can tell you the status and availability of indexes and con-
straints in your database.
Further in this section, we will leverage our movie dataset that we created in the previous
section and will create schema (indexes/constraints) using Cypher.
Search WWH ::




Custom Search