How can I improvise insertion performance after adding :TTL label in my existing label?

I am using PySpark to insert data into Neo4j on a daily basis. I insert ~5Millions rows from a CSV. It was all working fine and the Job was getting finished in 30 minutes.

Ever since I add TTL in the existing labels, I have started facing slower data insertion. This is my config for apoc.conf

apoc.ttl.enabled=true 
apoc.ttl.schedule=900
apoc.ttl.limit=60000

I tried adding index for the TTL label but still no help.

CREATE RANGE INDEX apoc_ttl_idx IF NOT EXISTS FOR (n:TTL) ON (n.ttl);

Neo4j version - 5.23.0

I am using neo4j-connector-apache-spark for inserting data from PySpark. Am I missing anything ? How can we make it faster ?

Hi,

Thank you for reaching out. Would it be possible for you to share your PySpark code as well, to enable us to have a more detailed look?

Thanks @erik.nord for the reply. I was able to solve this issue with appropriate index on the labels with keys.

All right, I am happy to hear that you found a solution!