diff --git a/trustgraph-flow/trustgraph/direct/cassandra_kg.py b/trustgraph-flow/trustgraph/direct/cassandra_kg.py index dc0f2c2b..116abe02 100644 --- a/trustgraph-flow/trustgraph/direct/cassandra_kg.py +++ b/trustgraph-flow/trustgraph/direct/cassandra_kg.py @@ -334,13 +334,14 @@ class KnowledgeGraph: count += 1 - # Execute batch every 100 triples to avoid oversized batches - if count % 100 == 0: + # Execute batch every 25 triples to avoid oversized batches + # (Each triple adds ~4 statements, so 25 triples = ~100 statements) + if count % 25 == 0: self.session.execute(batch) batch = BatchStatement() # Execute remaining deletions - if count % 100 != 0: + if count % 25 != 0: self.session.execute(batch) # Step 3: Delete collection metadata