How I Optimized EF Core Query from 30 Seconds to 30 Milliseconds
How to optimize a slow EF Core database query in Postgres: filter only needed rows, limit the number of JOINs, select only the columns you need, limit number of requests, avoid cartesian explosion and deep sub queries. Select the most optimal option in terms of performance and memory usage. Remember the golden software rule: measure first, then optimize.