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.

Streaming results with python vs javascript

kaptenh
Node Clone

Hi!
Im trying to make a big query to export results from a neo4j 4 database.
When using python to make the query, it seems results doesnt start streaming until the query has finished, which can take a very long time.
With javascript the results starts streaming pretty much at once.

I would like the second behaviour, but not use javascript.
Is it possible to make the python driver stream results as soon as they are available somehow?
Have I missed some config? I dont provide any extra configuration to the driver or session objects at all..

Thanks.

4 REPLIES 4

Which versions of Neo4j, Python driver, and JS driver have you been using for this test? I don't think there should be this kind a difference in behavior between the drivers (at least not in recent Neo4j versions).

dkm1006
Node Clone

@rouven.bauer I have made a similar observation using py2neo==2021.2.3 on a "Neo4j Community 4.4.3" database.
If I do something like

match = Vertex.match(graph).where(test_property='test')
for vertex in match:
    print(vertex.name)

then the streaming only starts after a while, and the memory use on the client machine goes up by a GB.

With the neo4j-driver (neo4j==4.4.2) itself, the record stream starts immediately. Do you know if there's a possibility to stream records in py2neo?

I'm sorry, but I don't know. I've only looked at py2neo superficially so far. And it's unlikely this will change as py2neo is unsupported by now. technige who is the main contributor to py2neo announced that he'd step back from actively maintaining it after leaving neo4j in the middle of last year.

wumirose
Node Clone

I have the same difficulty extracting data of about 653,000 rows from neo4j database via py2neo connection. Please keep me in the loop in case you find a way forward.