为什么Glimpse的"SQL"选项卡中的某些命令带有惊叹号图标为橙色? [英] Why are some commands in Glimpse's SQL tab orange with an exclamation icon?

查看:103
本文介绍了为什么Glimpse的"SQL"选项卡中的某些命令带有惊叹号图标为橙色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Glimpse的"SQL"选项卡将某些查询显示为橙色,在最左侧的列中带有感叹号图标.这是一个示例:

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

在研究中,我发现了这个Stackoverflow问题-橙色是什么-在该项目中引用了第435号问题,它来自2013年,内容为:

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.

不过,我认为这是不正确的,因为在我的情况下,所讨论的存储过程未在其中使用事务,并且也没有将其包装在调用它的.NET代码的事务中.

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.

所以我的问题是,为什么这个特殊的查询结果在Glimpse的SQL选项卡中显示为橙色并带有感叹号图标?不幸的是,将鼠标悬停在图标上时,没有工具提示或其他帮助.

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.

推荐答案

我下载了Glimpse代码以深入了解...

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

简而言之,Glimpse.Ado维护一个字典,该字典可跟踪在Web请求的生存期内每个特定命令文本已执行的次数. Web请求中先前已执行的所有命令文本都标记为 duplicate ,并且这些重复的请求在"Sql"选项卡中显示为橙色.

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.

不幸的是,使用存储过程时,命令文本只是存储过程的名称.因此,在确定调用是否重复时,Glimpse base仅位于存储过程名称之外,而不是其输入参数.因此,如果您的页面两次调用相同的sproc,但使用不同的输入参数,则Glimpse会将第二次调用标记为重复,即使它并不是真正的重复(因为有不同的参数).

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.

这篇关于为什么Glimpse的"SQL"选项卡中的某些命令带有惊叹号图标为橙色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆