SQL 查询需要时间
我需要知道,如果我有一组 1000 个查询,并且我一次执行它们。如果特定的查询集需要时间,那么可能的原因是什么,它需要时间以及我可以通过什么方式解决这个问题。
I need to know that if I am having a set of 1000 queries, and I am executing them in one go. If the particular set of queries taking time, then what can be the possible reason, it's taking time and by what means I can resolve this issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
介绍他们。通过使用您的
SID
查询v$session
可以看到所有正在运行的查询序列#
。获得SQL_Id
后,您可以使用 SQL_id 查询v$sql
以显示正在运行的查询。v$session
还显示了大量其他信息,包括等待状态、您可以查看并弄清楚要做什么的事件。通过
v$locked_object
查看是否有任何对象被锁定,从而阻止查询执行。进一步阅读:
Profile them. All running queries are can be seen by querying
v$session
with yourSID
&serial#
. Once you have theSQL_Id
, you can queryv$sql
with the SQL_id to show what query is running.v$session
also shows a wealth of other information, including wait states, events which you can go through and figure out what to.Go through
v$locked_object
to see if there are any objects which are locked, preventing the queries from executing.Further reading: