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!

direct path read temp

Mr.D.Apr 1 2015 — edited Apr 2 2015

Hi,

on my 11.2 RAC database on Linux servers,

i've a join on 2 table with this execution plan:

Execution Plan
----------------------------------------------------------
Plan hash value: 3669554776

-----------------------------------------------------------------------------------------------
| Id  | Operation           | Name            | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
-----------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT    |                 |   404K|    19M|       |   230K  (1)| 00:00:06 |
|   1 |  SORT ORDER BY      |                 |   404K|    19M|    26M|   230K  (1)| 00:00:06 |
|*  2 |   HASH JOIN         |                 |   404K|    19M|  2664K|   225K  (1)| 00:00:05 |
|*  3 |    INDEX RANGE SCAN | PK_TAB1         | 97158 |  1518K|       |   356   (1)| 00:00:01 |
|*  4 |    TABLE ACCESS FULL| TAB2            |   716K|    23M|       |   223K  (1)| 00:00:05 |
-----------------------------------------------------------------------------------------------


When using orderd hint, hash join order changes in:

Execution Plan
----------------------------------------------------------
Plan hash value: 2999560214

-----------------------------------------------------------------------------------------------
| Id  | Operation           | Name            | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
-----------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT    |                 |   404K|    19M|       |   230K  (1)| 00:00:06 |
|   1 |  SORT ORDER BY      |                 |   404K|    19M|    24M|   230K  (1)| 00:00:06 |
|*  2 |   HASH JOIN         |                 |   404K|    19M|    32M|   225K  (1)| 00:00:05 |
|*  3 |    TABLE ACCESS FULL| TAB2            |   716K|    23M|       |   223K  (1)| 00:00:05 |
|*  4 |    INDEX RANGE SCAN | PK_TAB1         | 97158 |  1518K|       |   356   (1)| 00:00:01 |
-----------------------------------------------------------------------------------------------

Seems more faster than the first.

But ORDER BY clause generate this event "direct path read temp" and it's very slow.

PGA is about 5Gb.

Advisor show me:

PGA Target Est (MB)Size FactrW/A MB ProcessedEstd Extra    W/A MB Read/   Written to Disk Estd PGA Cache Hit %Estd PGA Overalloc CountEstd Time
1,0240.134,438.614,304.6551.0003,400,405
2,0480.254,438.614,304.6551.0003,400,405
4,0960.504,438.614,304.6551.0003,400,405
6,1440.754,438.614,304.6551.0003,400,405
8,1921.004,438.614,304.6551.0003,400,405
9,8301.204,438.614,304.6551.0003,400,405
11,4691.404,438.614,304.6551.0003,400,405
13,1071.604,438.614,304.6551.0003,400,405

I've gathered awr during the query execution and this is the result:

EventWaitsTotal Wait Time (sec)Wait Avg(ms)% DB timeWait Class
DB CPU 570.9 83.3
direct path write temp10,55691913.3User I/O
direct path read1,58414.892.2User I/O

Tablespace IO:

TablespaceReadsAv Rds/sAv   Rd(ms)Av    Blks/Rd 1-bk  Rds/sAv 1-bk Rd(ms)WritesWrites avg/sBuffer WaitsAv Buf Wt(ms)
TEMP11,055150.0015.0120,4520.0002700.00

What can I check?

This post has been answered by Jonathan Lewis on Apr 2 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 30 2015
Added on Apr 1 2015
39 comments
5,836 views