Neo4j has an interesting approach to handling complexity beyond the core query model - a plugin system which adds procedures.
I had a query that was running out of memory. Turns out they have a batching system in one of their plugins.
https://morel.us-east.host.bsky.network/xrpc/com.atproto.sync.getBlob?did=did:plc:ragtjsm2j2vknwkz3zp4oxrd&cid=bafkreiam2mzrkt72utyuniysvwutyimkqlprv6kq5kfsacxofr64v2xf3e