简体   繁体   English

执行特定查询时的响应时间不同

[英]different response time when executing a specific query

I've been trying to figure out a performance issue for a while and would appreciate if someone can help me understand the issue. 我一直在尝试找出性能问题,如果有人可以帮助我理解该问题,我将不胜感激。

Our application is connected to Oracle 11g. 我们的应用程序已连接到Oracle 11g。 We have a very big table in which we keep data for last two months. 我们有一个很大的表,其中保存了过去两个月的数据。 We do millions of inserts every half an hour and a big bulk delete operation at the end of each day. 我们每半小时进行数百万次插入,并在每天结束时进行大批量删除操作。 Two of our columns are indexed and we definitely have skewed columns. 我们的两个列都已建立索引,并且我们肯定有倾斜的列。

The problem is that we are facing many slow responses when reading from this table. 问题是,从该表读取数据时,我们面临许多缓慢的响应。 I've done some researches as I am not a DB expert. 我不是数据库专家,所以已经做了一些研究。 I know about bind variable peeking and cursor sharing. 我知道绑定变量偷看和游标共享。 The issue is that even for one specific query with a specific parameters, we see different execution time! 问题是,即使对于具有特定参数的特定查询,我们也会看到不同的执行时间!

There is no LOB column in the table and the query we use to read data is not complex! 表中没有LOB列,用于读取数据的查询并不复杂! it looks for all rows with a specific name (column is indexed) within a specific range (column is indexed). 它会在特定范围(索引已索引)中查找具有特定名称(索引已索引)的所有行。

  • I am wondering if the large number of insertions/deletions we do could cause any issues? 我想知道我们进行的大量插入/删除操作是否会引起任何问题?
  • Is there any type of analysis we could consider to get more input on this issue? 我们是否可以考虑进行任何类型的分析以获得更多有关此问题的意见?

I can see several possible causes of the inconsistency of your query times. 我可以看到导致查询时间不一致的几种可能原因。

  1. The number of updates being done while your query is running. 查询运行时正在完成的更新数。 As long as there are locks on the tables you use in the query your query has to wait for them to be release. 只要您在查询中使用的表上有锁,查询就必须等待它们被释放。
  2. The statistics on the table can become very out of synch with this much data manipulation. 如此多的数据操作,表上的统计信息可能会变得非常不同步。 I would try two things. 我会尝试两件事。 First, I would find out when the DBMS_STATS.GATHER_DATABASE_STATS_JOB_PROC job is run and make sure the bulk delete is performed before this job each night. 首先,我将找出何时运行DBMS_STATS.GATHER_DATABASE_STATS_JOB_PROC作业,并确保每晚都在此作业之前执行批量删除。 If this does not help I would ask the DBA to set up DBMS_MONITOR on your database to help you trouble shoot the issue. 如果这样做没有帮助,我将要求DBA在您的数据库上设置DBMS_MONITOR,以帮助您解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM