mishrsud / mvc-mini-profiler

Automatically exported from code.google.com/p/mvc-mini-profiler
0 stars 0 forks source link

Feature: include parameter values in SQL output #18

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When running lots of parametrised SQL statements you can have a lot of 
duplicates:

select * from [table] t where t.ID = @id

Duplicate: select * from [table] t where t.ID = @id

Duplicate: select * from [table] t where t.ID = @id

And so on. 

However that is the same statement being called with different parameter values 
- could that not be taken into account.

Also, on the SQL results could any calls below some threshold be hidden? Say 
hide all SQL calls that took less than 15ms?

Original issue reported on code.google.com by keithhe...@gmail.com on 14 Jun 2011 at 8:46

GoogleCodeExporter commented 8 years ago
That is almost a textbook definition of an N+1 query.  This should probably be 
avoided.

If you are OK with your code, just ignore the little exclamation point.

Original comment by Spoonful...@gmail.com on 14 Jun 2011 at 9:49

GoogleCodeExporter commented 8 years ago
Not always: this would be the pattern seen if you had an N+1 style query, but 
you'll also see it in other circumstances - for instance checking settings and 
messages tables.

I think the best bet is to still flag them as duplicates, but to optionally 
include the parameter values in the output UI.

Original comment by keithhe...@gmail.com on 14 Jun 2011 at 10:03

GoogleCodeExporter commented 8 years ago

Original comment by jarrod.m.dixon on 14 Jun 2011 at 10:29

GoogleCodeExporter commented 8 years ago

Original comment by jarrod.m.dixon on 14 Jun 2011 at 10:42

GoogleCodeExporter commented 8 years ago
I've checked in a rudimentary, in-line replacement for the values.

Submit the inevitable bugs, please :)

Original comment by jarrod.m.dixon on 21 Jun 2011 at 8:26