Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-23-2019 11:46 PM
Hi,
I'm finding a weird behavior when using composite indexes. Say I have nodes :Output uniquely identified by tx_hash and output_index.
I create a contraint:
CREATE CONSTRAINT ON (o:Output) ASSERT (o.tx_hash, o.output_index) IS NODE KEY;
But queries are being super slow and when I issue an explain I get:
Now if I introduce a property index as:
CREATE INDEX ON :Output(tx_hash)
Same query has execution plan:
So my question is, what was wrong with the NODE KEY index and constraint. Why wasn't it enough for having fast queries? Given the distribution of the data, has the field order when defining the constraint something to do with performance of the index?
03-24-2019 07:32 AM
Explain doesn't tell you anything, it just uses estimates (based on index selectivity).
test it for real with real lookups and PROFILE
All the sessions of the conference are now available online