A read-only endpoint that returns fifty thousand rows is slow and memory-heavy in EF Core. What is the context doing?
The context snapshots every entity it loads so it can work out what changed at save time, which is useful for a handful of entities and pure overhead for a read. AsNoTracking removes the snapshot, and the same mechanism explains why a stray mutation on a tracked entity gets written even though you never called Update.