pythonneo4jpy2neo

What is the reason I'm seeing a Lookup index which is null when I run, graph.run(SHOW INDEXES;)?


I'm relatively new to using neo4j. I've connected to a database with the py2neo library and populated the database with the faker library to create nodes for Person and Address each with attributes attached to them. I'm interested in creating indexes and testing the performance of different indexes. These were the two indexes I had created

`# Step 3: Create Indexes for Persons and Addresses
graph.run(" CREATE INDEX IF NOT EXISTS FOR (p:Person) ON (p.name, p.dob, p.email, p.gender)")
graph.run("CREATE INDEX IF NOT EXISTS FOR (a:Address) ON (a.address, a.postcode, a.country)")'

I created some indexes and used the command

`graph.run("SHOW INDEXES;")`

Output

I was expecting 2 indexes to show but 3 indexes returned. The final one was a Look up type and had some null properties. That attached image shows the output, Why is this index showing up? Thanks.

I was expecting only 2 to return, so I'm thinking maybe this is some lack of understanding on my part? I've started reading through the Neo4j documentation on indexes but I'm still unsure. Any help would be appreciated. Thanks!


Solution

  • From my experience, neo4j creates 2 "lookup indexes" by default. (Not sure why you only saw one of them, but maybe the default indexes are only created when needed.)

    According to the neo4j operations manual:

    The token lookup index is the only index present by default in the database.

    And the documentation also states that there are actually 2 such lookup indexes: 1 for node labels, and 1 for relationship types.