Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Query throughput getting slow

User_OCZ1TDec 29 2016 — edited Jan 13 2017

I am using version- 11.2.0.4 of oracle.

I have a query running and its getting slow down during specific time period of the day(10PM to 9AM) which i can also verify from the data present in DBA_HIST_SQLSTAT. The number of rows processed getting decreased from ~25million to ~15k during those snap duartion(we have ~1hrs snap duration).So i wanted to understand what must be causing this? Is the database getting I/O bound during that period and that is the reason query startin to crawl? on 24th it started and also ran sucessfully ending on 25th but on 28th it started again and failed due to less throughput for specific duration.

I have verified the overall wait event pattern for the database from AWR views for the whole duration but i am not seeing anything(any specific wait event) matching with the slowness pattern.

Below is the details from the DBA_HIST_SQLSTAT which i have fetched.

PIO_PER_EXEC=  SUM (DISK_READS_delta) / GREATEST (SUM (executions_delta))

LIO_PER_EXEC=SUM (BUFFER_GETS_delta) / GREATEST (SUM (executions_delta))

ROWS_PER_EXEC= SUM (ROWS_Processed_delta) / GREATEST (SUM (executions_delta))

CPU_TIME_EXEC=SUM (CPU_TIME_delta) / GREATEST (SUM (executions_delta))

IO_PER_EXEC=SUM (IOWAIT_delta) / GREATEST (SUM (executions_delta))

MSEC_EXEC=SUM (ELAPSED_TIME_delta) / GREATEST (SUM (executions_delta))/1000000/60

        

SAMPLE_ENDEXECUTIONSPIO_PER_EXECLIO_PER_EXECROWS_PER_EXECCPU_TIME_EXECCONCURRENCY_PER_EXECIO_PER_EXECAPWAIT_PER_EXECMSEC_EXEC
12/24/2016 11:00:21.789 PM1911,6541,571,3278,416,081182,990,00001,076,931,483020
12/25/2016 12:00:53.270 AM02,239,5323,801,64721,767,760454,690,000101,7372,388,260,291046
12/25/2016 1:00:20.341 AM02,381,6313,657,53523,873,760476,270,0004032,290,160,611046
12/25/2016 2:00:50.414 AM02,154,5993,684,60020,973,600424,650,000205,7502,403,860,910047
12/25/2016 5:00:18.128 AM02,307,6963,735,47724,411,600436,320,0003842,351,422,668046
12/25/2016 6:00:46.834 AM02,454,7534,034,22927,168,000473,920,000221,0932,667,466,245051
12/25/2016 7:00:15.674 AM02,383,9353,932,10321,602,880479,990,000104,1062,643,161,207051
12/28/2016 5:00:41.011 PM11,587,1422,753,87015,827,761325,600,0002,8121,588,102,798031
12/28/2016 6:00:09.239 PM02,439,1773,765,10121,671,040494,990,0009382,530,918,932049
12/28/2016 7:00:36.233 PM02,739,8784,222,08325,590,000549,280,0003,8532,581,430,920051
12/28/2016 8:00:01.742 PM02,427,8553,540,81912,126,480374,150,0008,9872,925,070,924053
12/28/2016 9:00:27.976 PM02,411,9853,345,8329,792,240350,800,0004,8542,939,388,926053
12/28/2016 10:00:57.253 PM01,996,3162,530,619123,360200,650,00077,8183,344,876,119058
12/28/2016 11:00:23.343 PM0995,1831,050,84154,000107,470,0004,0773,676,336,455062
12/29/2016 12:00:51.845 AM02,154,7812,281,59061,200207,410,00020,5933,351,915,787058
12/29/2016 1:00:19.967 AM02,381,4322,781,29046,320224,800,00048,3183,586,522,047062
12/29/2016 2:00:51.087 AM02,141,4332,593,31618,720205,730,000107,9283,446,559,245060
12/29/2016 3:00:19.398 AM02,220,9812,697,71712,240209,920,00087,0953,357,908,786058
12/29/2016 4:00:47.843 AM02,327,6292,744,31214,640216,370,00055,2043,578,570,313062
12/29/2016 5:00:17.315 AM02,252,0083,035,58410,800208,520,00017,2523,407,514,422059
12/29/2016 6:00:46.542 AM02,415,7792,971,90616,560215,650,00011,6103,589,738,284062
12/29/2016 7:00:15.501 AM02,174,8552,716,01913,680205,610,00096,6043,413,766,410059
12/29/2016 8:00:43.423 AM02,242,1262,977,56115,120215,480,000309,2263,509,735,082061
12/29/2016 9:00:11.563 AM02,102,0902,701,7341,550,640225,770,00076,0873,308,148,580058
12/29/2016 10:00:43.270 AM02,383,8323,344,53513,835,040379,700,000162,7343,083,623,040056
12/29/2016 12:00:44.880 PM02,483,7613,907,28124,123,120494,430,00012,5022,766,323,426054

Below is the part of the real time monitoring plan for the failed query(snashot too old error) after running long hours, which shows considerable amount of time its just waiting for I/O. Now i digged down to the  waitevents from AWR views but not getting matched with the attern.

Global Information

------------------------------

Status              :  DONE (ERROR)                

Execution Started   :  12/28/2016 16:25:32         

First Refresh Time  :  12/28/2016 16:26:06         

Last Refresh Time   :  12/29/2016 10:38:39         

Duration            :  65587s                      

Fetch Calls         :  419280                      

Global Stats

==============================================================================

| Elapsed |   Cpu   |    IO    | Concurrency | Fetch | Buffer | Read | Read  |

| Time(s) | Time(s) | Waits(s) |  Waits(s)   | Calls |  Gets  | Reqs | Bytes |

==============================================================================

|   64469 |    5052 |    59415 |        1.47 |  419K |    54M |  41M | 311GB |

==============================================================================

===============================================================================================================================================================================================================

| Id |              Operation               |           Name           |  Rows   | Cost  |   Time    | Start  | Execs |   Rows   | Read | Read  |  Mem  | Activity |             Activity Detail              |

|    |                                      |                          | (Estim) |       | Active(s) | Active |       | (Actual) | Reqs | Bytes | (Max) |   (%)    |               (# samples)                |

===============================================================================================================================================================================================================

|  0 | SELECT STATEMENT                     |                          |         |       |     65191 |    +34 |     1 |     101M |      |       |       |     0.41 | Cpu (24)                                 |

|    |                                      |                          |         |       |           |        |       |          |      |       |       |          | SQL*Net more data to client (7)          |

|  1 |   TABLE ACCESS BY LOCAL INDEX ROWID  | A                        |       1 |  1356 |     65191 |    +34 |     1 |     101M |  18M | 135GB |       |    35.58 | Cpu (194)                                |

|    |                                      |                          |         |       |           |        |       |          |      |       |       |          | latch: object queue header operation (1) |

|    |                                      |                          |         |       |           |        |       |          |      |       |       |          | db file sequential read (2523)           |

|    |                                      |                          |         |       |           |        |       |          |      |       |       |          | read by other session (1)                |

|  2 |    NESTED LOOPS                      |                          |       1 | 24175 |     65191 |    +34 |     1 |     219M |      |       |       |     0.08 | Cpu (6)                                  |

|  3 |     MERGE JOIN CARTESIAN             |                          |       6 | 16310 |     63151 |    +34 |     1 |    11123 |      |       |       |          |                                          |

|  4 |      MERGE JOIN CARTESIAN            |                          |     179 | 15952 |     63151 |    +34 |     1 |    11123 |      |       |       |          |                                          |

|  5 |       MERGE JOIN CARTESIAN           |                          |       1 |     5 |         1 |    +34 |     1 |        1 |      |       |       |          |                                          |

|  6 |        NESTED LOOPS                  |                          |       1 |     3 |         1 |    +34 |     1 |        1 |      |       |       |          |                                          |

|  7 |         TABLE ACCESS BY INDEX ROWID  | B                        |       1 |     1 |         1 |    +34 |     1 |        1 |      |       |       |          |                                          |

|  8 |          INDEX UNIQUE SCAN           | B_PK                     |       1 |       |     65554 |    +34 |     1 |        1 |      |       |       |          |                                          |

|  9 |         SORT UNIQUE                  |                          |       1 |     2 |         1 |    +34 |     1 |        1 |      |       |       |          |                                          |

| 10 |          TABLE ACCESS BY INDEX ROWID | C                        |       1 |     2 |         1 |    +34 |     1 |        1 |      |       |       |          |                                          |

| 11 |           INDEX RANGE SCAN           | C_PK                     |       1 |     1 |         1 |    +34 |     1 |        1 |      |       |       |          |                                          |

| 12 |        BUFFER SORT                   |                          |       1 |     3 |         1 |    +34 |     1 |        1 |      |       |       |          |                                          |

| 13 |         SORT UNIQUE                  |                          |       1 |     2 |         1 |    +34 |     1 |        1 |      |       |       |          |                                          |

| 14 |          TABLE ACCESS BY INDEX ROWID | C                        |       1 |     2 |         1 |    +34 |     1 |        1 |      |       |       |          |                                          |

| 15 |           INDEX RANGE SCAN           | C_PK                     |       1 |     1 |         1 |    +34 |     1 |        1 |      |       |       |          |                                          |

| 16 |       BUFFER SORT                    |                          |    149K | 15950 |     63151 |    +34 |     1 |    11123 |      |       |    2M |          |                                          |

| 17 |        TABLE ACCESS BY INDEX ROWID   | D                        |    149K | 15947 |         1 |    +34 |     1 |    27920 |      |       |       |          |                                          |

| 18 |         INDEX RANGE SCAN             | D_IX1                    |    596K |  2017 |         1 |    +34 |     1 |    30115 |      |       |       |          |                                          |

| 19 |      BUFFER SORT                     |                          |       1 |   363 |     63151 |    +34 | 11123 |    11123 |      |       |       |          |                                          |

| 20 |       SORT UNIQUE                    |                          |       1 |     2 |         1 |    +34 |     1 |        1 |      |       |  2048 |          |                                          |

| 21 |        TABLE ACCESS BY INDEX ROWID   | C                        |       1 |     2 |         1 |    +34 |     1 |        1 |      |       |       |          |                                          |

| 22 |         INDEX RANGE SCAN             | C_PK                     |       1 |     1 |         1 |    +34 |     1 |        1 |      |       |       |          |                                          |

| 23 |     PARTITION RANGE ITERATOR         |                          |     707 |  1302 |     65191 |    +34 | 11123 |     219M |      |       |       |     0.03 | Cpu (2)                                  |

| 24 |      INDEX RANGE SCAN                | A_KEY1                   |     707 |  1302 |     65554 |    +34 | 11123 |     219M |  23M | 175GB |       |    63.91 | latch: cache buffers chains (1)          |

|    |                                      |                          |         |       |           |        |       |          |      |       |       |          | Cpu (288)                                |

|    |                                      |                          |         |       |           |        |       |          |      |       |       |          | db file sequential read (4488)           |

|    |                                      |                          |         |       |           |        |       |          |      |       |       |          | read by other session (107)              |

===============================================================================================================================================================================================================

This post has been answered by AndrewSayer on Jan 5 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 10 2017
Added on Dec 29 2016
46 comments
4,305 views