sqloracle11gdatabase-performanceresponse-timeoracle-enterprise-manager

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. 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! it looks for all rows with a specific name (column is indexed) within a specific range (column is indexed).


Solution

  • 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. 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.