Search code examples
glimpse

Why are some commands in Glimpse's SQL tab orange with an exclamation icon?


Glimpse's SQL tab shows some queries as orange with an exclamation icon in the leftmost column. Here's an example:

Glimpse SQL tab

In my research, I found this Stackoverflow question - What does orange mean in Glimpse's SQL tab? - which references issue #435 on Github for this project, which is from 2013 and states:

When a transaction is started but left uncommitted, a warning icon is displayed and the font colour is set to orange.

I don't think this is correct, though, because in my case the stored procedure in question doesn't use a transaction within it and it's not wrapped in a transaction from the .NET code calling it.

So my question is, why is this particular query result in Glimpse's SQL tab orange and decorated with an exclamation icon? There's no tooltip or other help when hovering over the icon, unfortunately.


Solution

  • I downloaded the Glimpse code to get to the bottom of this...

    In short, Glimpse.Ado maintains a dictionary that tracks the number of times each particular command text has been executed during the lifetime of a web request. Any command texts that have been executed previously in the web request are marked as duplicate and these duplicate requests are colored orange in the Sql tab.

    Unfortunately, when using stored procedures the command text is just the name of the stored procedure. Therefore, when determining if a call is a duplicate, Glimpse bases is just off the stored procedure name and not its input parameters. So if you have a page that calls the same sproc twice, but uses different input parameters, Glimpse will flag the second call as a duplicate even though it's not really a duplicate (since there are different parameters).

    In any event, I hope this helps someone else who wonders the same thing.