You should also iterate over the results.
And you should use parameters. the OR can be rewritten as

s.IDPostgres IN ['54','547'] AND  '2002-12-31' < d.vdata < '2004-01-01'

with params

s.IDPostgres IN {ids} AND {from} < d.vdata < {to}

you can measure the time like here:
https://gist.github.com/jexp/a6e990378987d66ff40e1bcff5f1d1b1#file-test-py

Michael

On Fri, Dec 30, 2016 at 5:32 PM, Jessica Marinho <[email protected]>
wrote:

>
> I developed the following script:
>
>
>
> from neo4j.v1 import GraphDatabase, basic_auth
>
>
> driver = GraphDatabase.driver("bolt://localhost", auth=basic_auth("neo4j",
> "1234"))
>
>
> session = driver.session()
>
>
> session.run("MATCH (s:Sensor)-[r]-(d:Data)-[r1]-(h:Hora)-[r2]-(p:Precipitacao)
> WHERE (s.IDPostgres = '54' OR s.IDPostgres = '547') AND d.vdata >
> '2002-12-31' AND d.vdata < '2004-01-01' RETURN s.IDPostgres, s.latitude,
> s.longitude,d.vdata,h.vhora,p.valor ORDER BY d.vdata;")
>
>
> session.close()
> Digite o código aqui...
>
>
> I want to take the the time I spent on this query.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to