I have a query that I’m running in EF Core hooked up to a SQLite database. I noticed it was running a bit slower than I expected, so I turned on the logs to output the query.
In the logs, I see:
<code>Executed DbCommand (2,883ms)
</code>
<code>Executed DbCommand (2,883ms)
</code>
Executed DbCommand (2,883ms)
However, when I run the query in DB Browser for SQLite, it only takes 100 ms. What could account for this difference?
Some details:
- The query returns 14K rows, with 5 columns that are all GUIDs. So I don’t think it’s a data transfer issue
- The query is part of a set of 5 queries that are run using
AsSplitQuery
(usingAsSingleQuery
it takes only 370 ms total) - I’ve tried with and without
AsNoTracking()
I can try to provide more details on the query if needed but I need to avoid posting proprietary info as much as possible.
I’ve tried running the query in a separate tool and I expected the timings to be the same!
2