Skip to Main Content

SQL & PL/SQL

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!

How to reduce the elapsed time on this query.

828912Aug 9 2011 — edited Aug 11 2011
Oracle10.2.0.5 on AIX6.1.


Here is the awrsql report of a query for a one hour window.



Here UNBILLED has 120million records which is partitioned and subpartitioned. It has 10 partitions and 312 subpartitions. One subpartition has 10M records, 10 others have 1M each and 270 subpartitions have 360K records each. And 31 subpartitions are empty.

And BILLED has 300K records.

Looking at report you can see that out of 984 seconds, 958 is used for IO. Machine is PowerPC_POWER5 with 8CPU and disk storage on EMC.


Stat Name                                Statement   Per Execution % Snap
---------------------------------------- ---------- -------------- -------
Elapsed Time (ms)                           984,327        5,561.2    28.6
CPU Time (ms)                                40,760          230.3    29.8
Executions                                      177            N/A     N/A
Buffer Gets                               1,923,456       10,867.0    46.9
Disk Reads                                  203,832        1,151.6    25.1
Parse Calls                                       0            0.0     0.0
Rows                                        106,200          600.0     N/A
User I/O Wait Time (ms)                     958,766            N/A     N/A
Cluster Wait Time (ms)                            0            N/A     N/A
Application Wait Time (ms)                        0            N/A     N/A
Concurrency Wait Time (ms)                        0            N/A     N/A
Invalidations                                     0            N/A     N/A
Version Count                                     1            N/A     N/A
Sharable Mem(KB)                                 31            N/A     N/A
          -------------------------------------------------------------
		  
		  
		  
SQL_ID akg45a750sh0u
--------------------
DELETE UNBILLED WHERE (MSG_ID, MSG_ID2,SPLIT_ROW_NUM) IN (SELECT MSG_ID,MSG_ID2, SPLIT_ROW_NUM FROM BILLED
WHERE BILL_REF_NO = :B2 AND BILL_REF_RESETS = :B1 )

Plan hash value: 3879210699

---------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                            | Name                          | Rows  | Bytes | Cost (%CPU)| Pstart| Pstop |
---------------------------------------------------------------------------------------------------------------------------
|   0 | DELETE STATEMENT                     |                               |       |       |     1 (100)|       |       |
|   1 |  DELETE                              | UNBILLED                      |       |       |            |       |       |
|   2 |   NESTED LOOPS                       |                               |     1 |   112 |     0   (0)|       |       |

|   3 |    TABLE ACCESS BY GLOBAL INDEX ROWID| BILLED                        |     1 |    65 |     0   (0)|     1 |     1 |
|   4 |     INDEX RANGE SCAN                 | BILLED_XCB_BILL_REF_TRANS     |     1 |       |     0   (0)|       |       |
|   5 |    INDEX UNIQUE SCAN                 | UNBILLED_PK                   |     1 |    47 |     0   (0)|       |       |
----------------------------------------------------------------------------------------------------------------------
Is there way to improve the elapsed time( currently 5,561.2 msec per execution) of the query?

Thanks for your time...
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 8 2011
Added on Aug 9 2011
12 comments
992 views