infra: neo4j generator creates indexes for fast relationship MERGE

This commit is contained in:
mo
2026-06-26 01:24:56 +00:00
parent 89b31c680a
commit 2f2cecd16f
@@ -88,6 +88,9 @@ def main():
auth=(DB_USER, DB_PASSWORD))
with driver.session() as session:
# Indexes make relationship MATCH/MERGE fast even with many existing nodes
session.run("CREATE INDEX product_id_idx IF NOT EXISTS FOR (p:Product) ON (p.product_id)")
session.run("CREATE INDEX supplier_id_idx IF NOT EXISTS FOR (s:Supplier) ON (s.supplier_id)")
print(f"Generating {TARGET_NODES} product nodes...")
print(f"Batch size: {BATCH_SIZE}")