r/programming • • Aug 25 '26

Solving the 1+N Query Problem

https://acadia.engineering/blog/solving-the-1-plus-N-query-problem
127 Upvotes

92 comments sorted by

View all comments

Show parent comment

1

u/modernkennnern Aug 26 '26

Something I've been looking into adding to one of our projects is updating our E2E snapshot tests — which as of now records all external requests as well as Activity (OpenTelemetry) happenings so I can see what's going on — to also log all SQL queries so we can see clear regressions in SQL queries.

My main blocker right now is the fact that if you have multiple inserts in one EF Core LINQ query then it generates a (documented) random ordering of the inserts, so the snapshots never match.

1

u/slvrsmth Aug 27 '26

Split on keywords, sort the lines? You just need an indicator "something changed", not a valid query.