# Is there any way of querying on small part of a big graph in graph db

**URL:** <https://community.neo4j.com/t/is-there-any-way-of-querying-on-small-part-of-a-big-graph-in-graph-db/22370>\
**Category:** Cypher\
**Tags:** cypher, knowledge-base\
**Created:** [July 26, 2020, 11:42am UTC](https://community.neo4j.com/t/is-there-any-way-of-querying-on-small-part-of-a-big-graph-in-graph-db/22370 "2020-07-26T11:42:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kalyan\_b\_aninda](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/kalyan_b_aninda/32/6079_2.png) [@kalyan\_b\_aninda](https://community.neo4j.com/u/kalyan_b_aninda)\
**Post date:** [July 26, 2020, 11:42am UTC](https://community.neo4j.com/t/is-there-any-way-of-querying-on-small-part-of-a-big-graph-in-graph-db/22370/1 "2020-07-26T11:42:14Z")

</div>

I am running gds algorithm(link prediction algorithm) in a graph db consist 10 million nodes and relations. It is taking huge amount of time in full node and relationship base.

`call apoc.export.csv.query("MATCH (p:Vehicle)-[r:takes_rent]->(p2:CUSTOMER)WHERE p2.BMCC IN ['1','10','11','12','14','18','19','2','20','21','22','23','24','25','27','2741','28','29','30','32','3351','36','4','4131','4215','4511','4722','4812','4814','4816','4899','4900','5','5039','5047','5065','5111','5199','5200','5211','5251','5261','5399','5411','5441','5511','5533','5541','5641','5651','5661','5697','5712','5722','5732','5733','5734','5811','5813','5814','5912','5940','5941','5942','5944','5947','5948','5950','5977','5992','6','7','7011','7210','7221','7230','7379','7399','7531','7629','763','7832','7911','7996','7997','7999','8021','8062','8099','9']return distinct(p.ID) as Vehicle_ID,p2.ID as customer_wallet,p2.BMCC as BMCC_CODE,gds.alpha.linkprediction.adamicAdar(p,p2,{relationshipQuery:'takes_rent'}) as score","prefescore_dump_adamic_ader.csv", {batchsize:10000})`

here I am using apoc library for dumping csv the result for parallel processing purpose. but it is taking huge time . Is there any way to make this query faster or how could I apply this query in small sample of this graph db

---

<div class="post-metadata">

**Author:** ![jggomez](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/jggomez/32/7793_2.png) [@jggomez](https://community.neo4j.com/u/jggomez)\
**Post date:** [July 26, 2020, 5:50pm UTC](https://community.neo4j.com/t/is-there-any-way-of-querying-on-small-part-of-a-big-graph-in-graph-db/22370/2 "2020-07-26T17:50:43Z")

</div>

Hi, You could use UNWIND. You can iterate the list of BMCC then create several files.

Thanks

---

<div class="post-metadata">

**Author:** ![kalyan\_b\_aninda](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/kalyan_b_aninda/32/6079_2.png) [@kalyan\_b\_aninda](https://community.neo4j.com/u/kalyan_b_aninda)\
**Post date:** [July 27, 2020, 5:17am UTC](https://community.neo4j.com/t/is-there-any-way-of-querying-on-small-part-of-a-big-graph-in-graph-db/22370/3 "2020-07-27T05:17:23Z")

</div>

the interesting fact is . The preferential attachment algorithm query took less time to finish. but Adamic ader, Common neighbour algorithm test queries didnt give me the output. Those query run for long time . So is it algorithm performance issue ?. My instance ram is 374gb and neo4j version is 3.5.11.

I am learning neo4j , could you kindly give me a Unwind statement sample format

---

<div class="post-metadata">

**Author:** ![jggomez](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/jggomez/32/7793_2.png) [@jggomez](https://community.neo4j.com/u/jggomez)\
**Post date:** [August 3, 2020, 2:37am UTC](https://community.neo4j.com/t/is-there-any-way-of-querying-on-small-part-of-a-big-graph-in-graph-db/22370/4 "2020-08-03T02:37:48Z")

</div>

Hi

> **[UNWIND - Cypher Manual](https://neo4j.com/docs/cypher-manual/current/clauses/unwind/)**
>
> \`UNWIND\` expands a list into a sequence of rows.
