MiniProfiler detects "duplicate" SQL queries and gives you a red exclamation mark in the corner when it detects them (I'm using MiniProfilerEF
to link in to my code-first EF database access). This is often very useful, but sometimes these duplicate queries are fully justified, like say when I'm updating 50 users in a parametrized way; 49 are going to be detected as duplicate queries.
Is there a way, then, for me to disable this duplicate SQL query detection for a block of code? Something like:
using (MiniProfiler.Current.Step("Do bulk updates"), Options.NoDuplicateSqlChecking) {
// ...
}
... would be good.
Looking at the MiniProfiler code, this line seems to be checking for duplicates:
https://github.com/SamSaffron/MiniProfiler/blob/master/StackExchange.Profiling/MiniProfiler.IDbProfiler.cs#L91
Doesn't look like there's any way to do this at the moment. I guess stats.IsDuplicate
would never have to be set to true
if this option were specified, but it's tricky only doing it for a particular block of code. Alternatively maybe the parameters as well as the SQL command string could be taken into account somehow, as they are likely to change, even with bulk operations.