How does the cypher query optimizer estimate number of rows if I have a predicate like "40 > n.age > 30" without any index?

16 views
Skip to first unread message

Sun Yuhan

unread,
Jul 19, 2017, 3:53:23 PM7/19/17
to Neo4j
If such a query is given " match (n:PEOPLE) where 40 > n.age > 30 return n", how does the query optimizer estimate the number of rows returned by the query? I know for relational database, they have histogram information about distribution of values for each attribute. But for a graph database, how does this estimation is made?

Or a point to the corresponding page of source code is really helpful. Thx!

Michael Hunger

unread,
Jul 20, 2017, 9:34:05 PM7/20/17
to ne...@googlegroups.com, Petra Selmer
We currently only have the selectivity of the index, histograms on value distributions are planned for some point in the future.

So I think it mostly multiplies the total number by the selectivity, but I'm not the expert there.

Perhaps Petra can point you to the right place in the code?

Cheers, Michael 

On Wed, Jul 19, 2017 at 9:53 PM, Sun Yuhan <wdmz...@gmail.com> wrote:
If such a query is given " match (n:PEOPLE) where 40 > n.age > 30 return n", how does the query optimizer estimate the number of rows returned by the query? I know for relational database, they have histogram information about distribution of values for each attribute. But for a graph database, how does this estimation is made?

Or a point to the corresponding page of source code is really helpful. Thx!

--
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 neo4j+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Petra Selmer

unread,
Jul 27, 2017, 2:45:00 PM7/27/17
to ne...@googlegroups.com, michael...@neo4j.com

Petra Selmer
Engineer and member of the Cypher Language Group

Neo Technology
8th Floor, Friars Bridge Court
41-45 Blackfriars Road
London SE1 8NZ
Reply all
Reply to author
Forward
0 new messages