Neo4j 2.0 How Long can a Cypher Query Be when Passed to the Execution Engine?

非 Y 不嫁゛ 提交于 2020-01-17 06:20:13

问题


Basically, what's the limit on query size?

I'm writing a query that searches all properties in the database for a string. At the end of the query, I take the results and sort them into buckets. This makes for a very long cypher query.

I'm passing this query to the Execution Engine in a server plug-in. Right now I have a limited amount of properties, so the query runs fine. I'm just concerned that as I get more properties over time that the actual string size of the query will be too long for the execution engine.

I've got a query that basically has a ton of lines like this:

MATCH (n) WHERE
( n:Program__CMC ) or    
n.learningObjective =~ '(?i).*criteria.*' or  
n.behavior =~ '(?i).*criteria.*' 

// This places the results into categories
WITH n  RETURN 
SUM(CASE when any(l IN labels(n) WHERE l='Program__CMC') THEN 1 ELSE 0 END) AS LABELProgram__CMC ,  
SUM(CASE WHEN  n.acronymn =~ '(?i).*criteria.*'  THEN  1 ELSE 0 END) AS NODEacronymn, SUM(CASE WHEN  n.behavior =~ '(?i).*criteria.*'  THEN  1 ELSE 0 END) AS NODEbehavior

This is just a very small subset of the query I'm running. I'm actually using parameters and searching on labels and relationships as well, but I left those out for clarity.

If there's a limit, and there's a possibility I'll reach it, then I'll have to split up the query and merge the results.


回答1:


There's no stated limit, although I've seen some interesting problems when you get into the several megabyte range, so it's not unlimited. I'm more worried that you're going to need to hit every node in the database for this query--is there no label you can filter on in the MATCH, at least?



来源:https://stackoverflow.com/questions/22259802/neo4j-2-0-how-long-can-a-cypher-query-be-when-passed-to-the-execution-engine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!