# Apoc.load.json from url got stuck

**URL:** <https://community.neo4j.com/t/apoc-load-json-from-url-got-stuck/59579>\
**Category:** General\
**Tags:** migrated\
**Created:** [September 23, 2022, 3:20am UTC](https://community.neo4j.com/t/apoc-load-json-from-url-got-stuck/59579 "2022-09-23T03:20:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nengkhoiba](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/nengkhoiba/32/10018_2.png) [@nengkhoiba](https://community.neo4j.com/u/nengkhoiba)\
**Post date:** [September 23, 2022, 3:20am UTC](https://community.neo4j.com/t/apoc-load-json-from-url-got-stuck/59579/1 "2022-09-23T03:20:03Z")

</div>

Hi everyone,

I have the below query to load 4mb of json data and it got stuck without any warning or error only kept on spinning.

If anybody can help or suggest me a solution that will be helpful.

You can directly run the query if you want to check

```auto
CALL apoc.periodic.iterate(
	"CALL apoc.load.json('https://s3.eu-central-1.amazonaws.com/demo.hcpspace.app/bulk_connections.json')
	YIELD value as row",
	"MERGE(n:People{uuid: row.uuid})
	WITH n,row
		UNWIND row.uuids as uuid
		MERGE(p:People{uuid: uuid})
		MERGE(n)-[:FOLLOW]->(p)",
	{batchSize:100, parallel:true})

```

---

<div class="post-metadata">

**Author:** ![nengkhoiba](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/nengkhoiba/32/10018_2.png) [@nengkhoiba](https://community.neo4j.com/u/nengkhoiba)\
**Post date:** [September 23, 2022, 12:09pm UTC](https://community.neo4j.com/t/apoc-load-json-from-url-got-stuck/59579/2 "2022-09-23T12:09:09Z")

</div>

I totally forgot to create index. I was recreating the db and forgot to add index. Thank you for pointing out

---

<div class="post-metadata">

**Author:** ![glilienfield](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/glilienfield/32/27534_2.png) [@glilienfield](https://community.neo4j.com/u/glilienfield)\
**Post date:** [September 23, 2022, 3:35am UTC](https://community.neo4j.com/t/apoc-load-json-from-url-got-stuck/59579/3 "2022-09-23T03:35:33Z")

</div>

If you execute the apoc.load.json and look at the results, there are 70,251 records. I tried your query and it kept spinning. I add the following index and it completed in around 7 sec.

```auto
CREATE INDEX ON :People(uuid)

```

I would say the problem is the MERGE statements that have to look up the node by 'uuid'. Without the index this is a node scan, which takes longer and longer as the number of nodes increases.
