Improved Neo4j display mode performance

In my Spring Data Neo4j project, I used the simple and advanced Neo4j display mode. As I moved from simple to advanced matching, the project's performance is many, and I mean really much better than before. I donโ€™t have exact numbers, but thatโ€™s probably a lot. Can anyone clarify why advanced matching mode is superior to simple matching?

I read the programming page from the SDN documentation, but I could not find the exact reason.

For the record, I use @Transactional support from Spring.

+4
source share
2 answers

Yes, thatโ€™s true, since extended mapping is just a thin shell around nodes and links and is written to db (and read too). Simple mapping copies data to. To preserve this benefit, use advanced matching only in transactions, and you will be happy.

If you start modifying entities outside of transactions, you will get dirty object tracking and it will start copying stuff back.

+5
source

I noticed that with a simple comparison, there are a lot of unnecessary pinouts of labels, although they should not be. Even if you do not use @Fetch, the SDN still retrieves (for some reason) the labels for all nodes in the corresponding set, and in some cases even further.

For example, I had two teams in which there were about 100 members, and the teams were also connected to each other (as a parent), and @Fetch was not used anywhere, the performance was still terrible.

So, I switched to advanced matching to get rid of unnecessary selection of shortcuts. In my opinion, a simple mapping should not be available anymore, because it works so poorly with the new TypeRepresentationStrategy database. It looks like it is no longer designed to fit the labels.

0
source

All Articles