cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Create index in the background

Hello there!
In Neo4j 4.3 index on relationship was introduced.
So I created it and run multiple queries to test if performance improved, and, unfortunately, I don't see any improvement.

In the documentation I found next line:
"Note that the index is not immediately available, but is created in the background"
So I guess index wasn't created yet.

Finally, my question is: Is there any way to found out if index was actually created and available?

2 REPLIES 2

@iamandriikol

call db.indexes() will show all indexes for a database and will report if the index is ONLINE OR POPULATING

The overwhelming likelihood here is that the queries you executed simply didn't need a rel index for best performance. Here's a quick breakdown of why I think so.
.
We first need to consider how Neo4j uses indexes. Unlike RDBMS, which uses indexes extensively throughout traversal, Neo4j only uses an index once: when locating the starting point for traversal (the anchor).
.
So even if you added tons of rel property indexes, they will only be used if the query will be most efficient anchoring on a relationship attribute (Type or prop) instead of a node attribute. And as it happens, these kinds of situations are relatively uncommon. They only come about when you have a data model and problem domain where relationships have attributes that make them more strongly differentiated than their associated nodes in the relevant context. These are generally going to be graphs with lots of dense nodes, and/or graphs with lots of rel properties and relatively few differentiated Types.