How Acadia Eliminates the 1+N Query Problem
Solving the 1+N Query Problem
The 1+N query problem plagues ORMs when innocent-looking loops trigger a separate database query per row. Acadia's query language eliminates this by design: it lacks recursive functions and for loops, drawing on Datalog's guarantees. This ensures all queries terminate in polynomial time, making it impossible to write an infinite loop or accidental N+1 queries. The post explains the problem, the Datalog inspiration, and shows how Acadia's intersect operation replaces joins.
Without for loops or recursion, there is no way for a program to end up in an infinite loop.