PgOrderRepo.insert_order inserts each order line with a separate await conn.execute(...) in a loop (N+1). A single multi-row insert / executemany would be more efficient.
Order creation is low-frequency and uncontended, so this is a performance nicety rather than a correctness issue. Pairs naturally with bounding CreateOrderRequest.lines (see related issue).
src/quartermaster/adapters/postgres/unit_of_work.py — PgOrderRepo.insert_order
Deferred follow-up from the review of feat/api-http-layer.
PgOrderRepo.insert_orderinserts each order line with a separateawait conn.execute(...)in a loop (N+1). A single multi-row insert /executemanywould be more efficient.Order creation is low-frequency and uncontended, so this is a performance nicety rather than a correctness issue. Pairs naturally with bounding
CreateOrderRequest.lines(see related issue).src/quartermaster/adapters/postgres/unit_of_work.py—PgOrderRepo.insert_orderDeferred follow-up from the review of
feat/api-http-layer.