database icon indicating copy to clipboard operation
database copied to clipboard

WIP POC for better perf.

Open ItzNotABug opened this issue 4 months ago • 1 comments

Optimize relationship writes with bulk operations.

Adds bulk insert/update methods to avoid N+1 queries when creating relationships. Junction table links now use batch inserts, and one-to-many/many-to-one relationships use SQL UPDATE with IN clauses instead of individual updates. Includes updateManyByIds() adapter method and benchmarks.

Controlled via DB_RELATIONSHIP_BULK_WRITES env var (enabled by default) for before/after tests in benchmarks.

ItzNotABug avatar Oct 12 '25 07:10 ItzNotABug