是否有类似于 Java/.Net 分析器的 SQL Server 分析器?

发布于 2024-07-06 23:55:48 字数 503 浏览 5 评论 0原文

我喜欢分析 Java/.Net 应用程序以查找性能瓶颈或内存问题的方式。 例如,通过查看 调用树,其中包含每个方法的执行时间和调用计数。 在SQL Server中,我有存储过程调用依赖于视图的其他存储过程,这类似于Java/.Net方法调用其他方法。 所以看来同一种分析器在这里会非常有帮助。 然而,我找遍了所有地方,都没有找到。 有谁知道这样的工具,无论是用于 SQL Server 还是任何其他 DBMS?

更新:感谢您对 SQL Server Profiler 的回复,但这个工具非常有限。 查看屏幕截图

I love the way I can profile a Java/.Net app to find performance bottlenecks or memory problems. For example, it's very easy to find a performance bottleneck looking at the call tree with execution times and invocation counts per method. In SQL Server, I have stored procedures that call other stored procedures that depend on views, which is similar to Java/.Net methods calling other methods. So it seems the same kind of profiler would be very helpful here. However, I looked far and wide and could not find one. Is anyone aware of such tools, either for SQL Server or any other DBMS?

Update: Thanks fro your replies around SQL Server Profiler, but this tool is very limited. Take a look at the screenshot.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

注定孤独终老 2024-07-13 23:55:54

有 sql server profiler,但尽管它的名字如此,但从你的问题的声音来看,它并没有做你想做的事。 它将向您显示数据库中正在进行的所有呼叫的详细视图。 最好将应用程序作为一个整体进行故障排除,而不仅仅是一次一个存储过程

听起来您需要在查询分析器查看查询/spocs的执行计划,并且会给你一些类似于你正在寻找的数据的东西。

There's the sql server profiler, but despite it's name, it doesn't do what you want, by the sound of your question. It'll show you a detailed view of all the calls going on in the database. It's Better for troubleshooting the app as a whole, not just one sproc at a time

Sounds like you need to view the execution plan of your queries/spocs in query analyzer and that will give you something akin to the data you are looking for.

总攻大人 2024-07-13 23:55:54

您可以使用 Sql Profiler - 它涵盖了分析方面,但是我更倾向于将其视为一种日志工具。
为了诊断性能,您可能应该只查看查询计划

You could use Sql Profiler - which covers the profiling aspect, but I tend to think of it more as a logging tool.
For diagnosing performance, you should probably just be looking at the query plan.

昔梦 2024-07-13 23:55:54

正如几个回复所提到的,SQL Profiler 将显示您所要求的内容。 您必须确保打开事件 SP:StmtCompleted(位于“存储过程”组中),如果您还需要查询计划,请打开“显示计划 XML 统计配置文件”(位于“性能”组中) 。 最后一个 XML 计划为您提供了图形描述,并显示了计划中每个步骤处理的实际行。

如果探查器降低了您的应用程序的速度,请尽可能过滤它并考虑进行服务器端跟踪。

华泰
安迪

As mentioned by several replies the SQL Profiler will show what you're asking for. What you'll have to be sure to do is to turn on the events SP:StmtCompleted, which is in the Stored Procedures group, and if you want the query plans as well turn on Showplan XML Statistics Profile, which is in the Performance group. The XML plan last one gives you a graphical description and shows the actual rows processed by each step in the plan.

If the profiler is slowing your app down, filter it as much as possible and consider going to a server side trace.

HTH
Andy

飘过的浮云 2024-07-13 23:55:53

要查找性能瓶颈,您可以使用数据库引擎优化顾问(位于 SQL Server Management Studio 的“工具”菜单中)。它提供优化查询的建议,并自动为您优化它们(例如创建适当的索引等)。

To find performance bottlenecks, you can use the Database Engine Tuning Advisor (found in Tools menu of SQL Server Management Studio. It provides suggestions for optimizing your queries and offers to optimize them for you automatically (e.x. create the appropriate indexes, etc.).

闻呓 2024-07-13 23:55:53

如前所述,SQL Server Profiler 非常适合检查您的程序传递给 SQL 的参数等。但它不会向您显示执行树(如果您需要的话)。 为此,我能想到的就是使用 Show Plan 来查看运行时到底执行了什么。 例如,如果您正在调用一个调用视图的 sp,Profiler 只会显示该 sp 已执行以及传入的参数。
此外,Windows 性能监视器还具有特定于 SQL Server 的大量运行时性能指标。 您可以在服务器上运行它,也可以远程连接。

As mentioned, SQL Server Profiler, which is great for checking what parameters you're program is passing to SQL etc. It won't show you an execution tree though if that's what you need. For that, all I can think of is to use Show Plan to see what exactly is executed at run-time. E.g. if you're calling an sp that calls a view, Profiler will only show you that the sp was executed and what params were passed in.
Also, the Windows Performance Monitor has extensive run-time performance metrics specific to SQL Server. You can run it on the server, or connect remotely.

但可醉心 2024-07-13 23:55:52

除了 SQL Server Profiler 之外(正如 @Galwegian 的评论中提到的),还可以在运行查询时检查执行计划。

http://www.sql-server-performance.com/tips/query_execution_plan_analysis_p1。 .aspx
http://en.wikipedia.org/wiki/Query_plan

In addition to SQL Server Profiler, as mentioned in a comment from @Galwegian, also check out your execution plan when you run a query.

http://www.sql-server-performance.com/tips/query_execution_plan_analysis_p1.aspx
http://en.wikipedia.org/wiki/Query_plan

挽你眉间 2024-07-13 23:55:52

关于 SQL Server 探查器的另一个完整线程:

识别 SQL Server 性能问题

我明白你在说什么大约,但通常,数据库优化发生在更细粒度的级别。 如果数据库活动是由客户端驱动的,您应该能够使用现有的客户端分析器来获取每个步骤的总时间,然后解决容易实现的目标(无论是否在数据库中)。

当您需要详细分析特定数据库步骤时,可以使用分析器和跟踪。

通常,数据库访问具有一定的粒度,该粒度是在个体的基础上进行处理的,并且数据库活动与正在进行的各种用户访问不是线性的,而程序分析器通常分析代码的线性路径。

Another whole thread about the SQL Server profiler:

Identifying SQL Server Performance Problems

I understand what you are talking about, but typically, database optimization takes place at a finer grained level. If the database activity is driven from a client, you should be able to use the existing client profiler to get the total time on each step and then address the low hanging fruit (whether in the database or not).

When you need to profile a particular database step in detail, you can use profiler and a trace.

Typically, the database access has a certain granularity which is addressed on an individual basis and database activity is not linear with all kinds of user access going on, whereas a program profiler is typically profiling a linear path of code.

执着的年纪 2024-07-13 23:55:49

查看 SQL Nexus 工具。 这有一些关于识别瓶颈的很好的报告。
SQL Nexus 是一款可帮助您确定 SQL Server 性能问题的根本原因的工具。 它加载并分析 SQLDiag 和 PSSDiag 收集的性能数据。 它可以大大减少您手动分析数据所花费的时间。

在《Inside SQL 2005》一书中(可能是 T-SQL 查询)中,有一种很酷的技术,作者将 SQL 探查器输出转储到表或 Excel 文件中,并应用数据透视来获取与您的格式类似的输出。截屏。

我还没有看到任何内置的 SQL 工具可以提供这种分析。
另一个有用的 发布

Check out SQL Nexus Tool. This has some good reports on identifying bottlenecks.
SQL Nexus is a tool that helps you identify the root cause of SQL Server performance issues. It loads and analyzes performance data collected by SQLDiag and PSSDiag. It can dramatically reduce the amount of time you spend manually analyzing data.

In one of the Inside SQL 2005 books (maybe T-SQL Querying), there was a cool technique in which the author dumps the SQL profiler output to a table or excel file and applies a pivot to get the output in a similar format as your screenshot.

I have not seen any built-in SQL tools which gives you that kind of analysis.
Another useful post.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文