apoc icon indicating copy to clipboard operation
apoc copied to clipboard

apoc.do.case not populating UpdateStatistics

Open UniqueConstraint opened this issue 1 year ago • 1 comments

An apoc.do.case statement, to merge relationships based on matching relationship properties, is not producing any UpdateStatistics e.g. relationshipCreated. All values in UpdateStatistics return zero.

I noticed other apoc functionality have versions with stats e.g. apoc.merge.relationshipWithStats

Is there a workaround or fix for apoc.do.case?

UniqueConstraint avatar May 23 '24 11:05 UniqueConstraint

@UniqueConstraint That update statistics are not shown in general for procedures is not a bug, but a known limitation of the Neo4j procedure framework. It is tracked internally as a future improvement to do for the procedure framework. I suppose that the withStats versions of some procedures as you mention is a workaround of sorts for these specific procedures but I am unfortunately not aware of any general workaround.

If you wish I could track adding withStats versions for more APOC procedures as a feature request, but as APOC core is currently in maintenance mode with only a limited number of people working on it (focusing on support), it is not anything that will happen soon.

Best regards Louise, Neo4j

Lojjs avatar May 27 '24 09:05 Lojjs

Hey! Thanks for writing in, as of Cypher 25 there is now native support for conditional queries, due to that, there are no plans to update the APOC workaround. I recommend migrating to Cypher as that will contain the correct statistics.

gem-neo4j avatar Jul 02 '25 05:07 gem-neo4j