Performance 对cypher查询的性能改进

Performance 对cypher查询的性能改进,performance,nosql,neo4j,cypher,Performance,Nosql,Neo4j,Cypher,这可以加快查询速度。对于2条lac记录,大约需要30秒 start pn=node (10580) match pn--n-[rel:PAYS]-(companies) with n,rel, companies match n,companies-[:BELONGS_TO]->()-->(parentInd) where id(parentInd) in [10587,10657,13009,11957,10571,20980,10554,11541,116

这可以加快查询速度。对于2条lac记录,大约需要30秒

start pn=node   (10580)  
match pn--n-[rel:PAYS]-(companies)   with n,rel, companies  
match n,companies-[:BELONGS_TO]->()-->(parentInd)  
where id(parentInd) in   [10587,10657,13009,11957,10571,20980,10554,11541,11649,15339,10604,10959,10575,15302,10584,10564,10773,10597,10930,11336,10578,10674,11622,10592,14754,10611,10652,15326,11213,11429,18180,14432,12249,10785,11810,10763,12333,10944,12988,12783,12258,11778,20503,10927,16216,10552,10635,13887,12814,19424,11943,10671,10627,11202,16363,10712,12048,11128,11036,15973,10660,13083,13778,13405,13985,18313,13760,10956,11003,11472,11197,14376,10695,10644,11965,12097,13196,10719]  
with n, rel, companies  
match companies-[:LOCATED_IN]->()-->(region)  
where id(region) in    [1,2,3,4,5,6,7]  
with n, rel, companies  
match companies-[:SUB_OF]->()-->(gcbP)  
where id(gcbP) in    [13,8,11,9,10,12]  
and rel.source in ['Bloomberg','Wire','Trade BIR']  
and rel.transactionAmount > 1 and rel.transactionAmount < 9792562211034  
and rel.transactionDate > 946702800000 and rel.transactionDate < 1372651200000  
return        rel.source as DESCRIPTION, sum(rel.transactionAmount) as TRANSACTION_AMOUNT, count(*) as TRANSACTION_COUNT, "EXTERNAL" as TRANSACTION_TYPE,    n.companyParentName as D_ULTIMATE_PARENT_NAME, n.companyParentCity as d_ultimate_parent_city, n.companyParentState as d_ultimate_parent_state, n.companyParentCountry as d_ultimate_parent_country,    n.companyName as D_CUSTOMER_NAME, n.companyCity as d_customer_city, n.companyState as d_customer_state, n.companyCountry as d_customer_country,    companies.companyParentName as C_ULTIMATE_PARENT_NAME, companies.companyParentCity as c_ultimate_parent_city, companies.companyParentState as c_ultimate_parent_state, companies.companyParentCountry as c_ultimate_parent_country,    companies.companyName as C_CUSTOMER_NAME, companies.companyCity as c_customer_city, companies.companyState as c_customer_state, companies.companyCountry as c_customer_country,    n.companyIndustry as D_CUST_INDUSTRY_LEVEL_1, companies.companyIndustry as C_CUST_INDUSTRY_LEVEL_1, n.companyParentGCB as D_UP_GCP_PRIORITY, companies.companyParentGCB as C_UP_GCP_PRIORITY    ;**  
start pn=节点(10580)
将pn--n-[rel:PAYS](公司)与n,rel,companys匹配
匹配n,companys-[:属于]->()-->(parentInd)
其中id(parentInd)位于[10587,10657,13009,11957,10571,20980,10554,11541,11649,15339,10604,10959,10575,15302,10584,10564,10773,10597,10930,11336,10578,10674,11622,10592,14754,10611,10652,15326,11213,11429,18180,14432,12249,10785,11810,10763,12333,10944,12988,12783,12258,11778,20503,10927,16216,10552,10635,13887,12814,19424,11943,10671,10627,11202,16363,10712,12048,11128,11036,15973,10660,13083,13778,13405,13985,18313,13760,10956,11003,11472,11197,14376,10695,10644,11965,12097,13196,10719]  
与n,rel,公司
匹配公司-[:位于]->()-->(地区)
其中[1,2,3,4,5,6,7]中的id(区域)
与n,rel,公司
匹配公司-[:子单位]->()-->(gcbP)
其中[13,8,11,9,10,12]中的id(gcbP)
以及['Bloomberg'、'Wire'、'Trade BIR'中的rel.source
和rel.transactionmount>1和rel.transactionmount<9792562211034
和rel.transactionDate>946702800000和rel.transactionDate<1372651200000
返回相对源作为描述,总和(相对TransactionMount)作为交易金额,计数(*)作为交易计数,“外部”作为交易类型,n.companyParentName作为D_最终_母公司名称,n.companyParentCity作为D_最终_母公司城市,n.companyParentState作为D_最终_母公司国家,n.companyParentCountry作为D_最终_母公司国家,n.companyName作为D客户名称,n.companyCity作为D客户城市,n.companyState作为D客户国家,n.companyCountry作为D客户国家_客户所在国家/地区,公司名称。公司名称:C\U ULTIMATE\U PARENT\U名称,公司名称:C\U ULTIMATE\U PARENT\U city,公司名称:C\U ULTIMATE\U PARENT\U州,公司名称:C\U国家/地区公司国家为客户国家,公司国家为客户国家,公司工业为客户工业1级,公司工业为客户工业1级,公司工业为客户工业1级,公司工业为客户工业1级,公司特许经营权为GCP优先权,公司特许经营权为GCP优先权;**

这是否改善了它?请在上面的评论中发送详细信息

start pn=node   (10580), parentInd=node(10587,10657,13009,11957,10571,20980,10554,11541,11649,15339,10604,10959,10575,15302,10584,10564,10773,10597,10930,11336,10578,10674,11622,10592,14754,10611,10652,15326,11213,11429,18180,14432,12249,10785,11810,10763,12333,10944,12988,12783,12258,11778,20503,10927,16216,10552,10635,13887,12814,19424,11943,10671,10627,11202,16363,10712,12048,11128,11036,15973,10660,13083,13778,13405,13985,18313,13760,10956,11003,11472,11197,14376,10695,10644,11965,12097,13196,10719),
region=node(1,2,3,4,5,6,7), gcbP=node(13,8,11,9,10,12)
match companies-[:BELONGS_TO]->()-->(parentInd) 
with companies,pn
match pn--n-[rel:PAYS]-(companies)   with n,rel, companies  
match companies-[:LOCATED_IN]->()-->(region)  
with n, rel, companies  
match companies-[:SUB_OF]->()-->(gcbP)  
where 
rel.source in ['Bloomberg','Wire','Trade BIR']  
and rel.transactionAmount > 1 and rel.transactionAmount < 9792562211034  
and rel.transactionDate > 946702800000 and rel.transactionDate < 1372651200000  
return        rel.source as DESCRIPTION, sum(rel.transactionAmount) as TRANSACTION_AMOUNT, count(*) as TRANSACTION_COUNT, "EXTERNAL" as TRANSACTION_TYPE,    n.companyParentName as D_ULTIMATE_PARENT_NAME, n.companyParentCity as d_ultimate_parent_city, n.companyParentState as d_ultimate_parent_state, n.companyParentCountry as d_ultimate_parent_country,    n.companyName as D_CUSTOMER_NAME, n.companyCity as d_customer_city, n.companyState as d_customer_state, n.companyCountry as d_customer_country,    companies.companyParentName as C_ULTIMATE_PARENT_NAME, companies.companyParentCity as c_ultimate_parent_city, companies.companyParentState as c_ultimate_parent_state, companies.companyParentCountry as c_ultimate_parent_country,    companies.companyName as C_CUSTOMER_NAME, companies.companyCity as c_customer_city, companies.companyState as c_customer_state, companies.companyCountry as c_customer_country,    n.companyIndustry as D_CUST_INDUSTRY_LEVEL_1, companies.companyIndustry as C_CUST_INDUSTRY_LEVEL_1, n.companyParentGCB as D_UP_GCP_PRIORITY, companies.companyParentGCB as C_UP_GCP_PRIORITY    ;
start pn=node(10580),parentInd=node(10587,10657,13009,11957,10571,20980,10554,11541,11649,15339,10604,10959,10575,15302,10584,10564,10773,10597,10930,11336,10578,10674,11622,10592,14754,10611,10652,15326,11213,11429,18180,14432,12249,10785,11810,10763,12333,10944,12988,12783,12258,11778,20503,10927,16216,10552,10635,13887,12814,19424,11943,10671,10627,11202,16363,10712,12048,11128,11036,15973,10660,13083,13778,13405,13985,18313,13760,10956,11003,11472,11197,14376,10695,10644,11965,12097,13196,10719),
区域=节点(1,2,3,4,5,6,7),gcbP=节点(13,8,11,9,10,12)
匹配公司-[:属于]->()-->(parentInd)
与公司合作,pn
将pn--n-[rel:PAYS](公司)与n,rel,companys匹配
匹配公司-[:位于]->()-->(地区)
与n,rel,公司
匹配公司-[:子单位]->()-->(gcbP)
哪里
相关资料来源于['Bloomberg','Wire','Trade BIR']
和rel.transactionmount>1和rel.transactionmount<9792562211034
和rel.transactionDate>946702800000和rel.transactionDate<1372651200000
返回相对源作为描述,总和(相对TransactionMount)作为交易金额,计数(*)作为交易计数,“外部”作为交易类型,n.companyParentName作为D_最终_母公司名称,n.companyParentCity作为D_最终_母公司城市,n.companyParentState作为D_最终_母公司国家,n.companyParentCountry作为D_最终_母公司国家,n.companyName作为D客户名称,n.companyCity作为D客户城市,n.companyState作为D客户国家,n.companyCountry作为D客户国家_客户所在国家/地区,公司名称。公司名称:C\U ULTIMATE\U PARENT\U名称,公司名称:C\U ULTIMATE\U PARENT\U city,公司名称:C\U ULTIMATE\U PARENT\U州,公司名称:C\U国家/地区公司国家为客户国家,公司国家为客户国家,n.公司工业为客户工业1级,公司工业为客户工业1级,n.公司工业为客户工业1级,n.公司分包商为总承包商优先,公司分包商为总承包商优先;

start pn=node(10580)返回多少行匹配pn--n-[rel:PAYS](公司)和公司返回多少行-[:belient_TO]->()-->(parentInd),其中id(parentInd)在[10..]。也将id列表移动到start子句中?也将id列表移动到start子句中。表示查询的位置?有什么建议吗?这些都是节点id的权利?因此类似于start pn=node(10580,parentInd=node(1058710657等)。然后您不需要id(parentId)在match中,我尝试使用新语法,但在性能方面没有帮助。有多少行由start pn=node(10580)match pn--n-[rel:PAYS]-(companys)返回,有多少行由companys-[:behing_TO]->()-->(parentInd)返回,其中id(parentInd)在[10….]中。