这个密码查询可以更快吗?对于 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 ;**