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!

Concurrency During Insert

User_OCZ1TOct 21 2018 — edited Oct 30 2018

We are  using version 11.2.0.4 of oracle Exadata 2 node-RAC. But we have mainly application runs on one node. We have a Insert statement which slows down(elapsed time increased from ~1milli sec/execution to 9milli sec/execution) many of the time and apart from the usual waits , we see high concurrency(enq: TX - index contention and buffer busy waits). The top "segment by buffer busy waits, segments by ITL waits, segments by row lock waits" showing two of the indexes from this table. one is unique  index on a column(FID) and is populated by Oracle sequence and other is on a date column(CR_DT). This table is list-range composite partitoned but the indexes are all global indexes as because the queries are not using the partition/subpartition key in all scenarios.In total there are 8 indexes on this table including one function based index.As per current statistics , on an Avg there happen to be ~70million rows INSERTS in a day. Max ~5million inserts in an hour. See some of the figures related to index block splits on the instance activity stats section of the AWR report, yet to relate those to the issue. Need experts suggestions on how should i approach to reduce these waits and improve the performance?

Below is the table, and specific column and index statistics:-

TABLE_NAME    NUM_ROWS    BLOCKS    AVG_ROW_LEN    SAMPLE_SIZE

TAB1    1296442200    106007359    155    12964422

COLUMN_NAME    DATA_TYPE    NUM_DISTINCT    DENSITY    NUM_NULLS    SAMPLE_SIZE

FID    NUMBER    1296036400    7.71583267260086E-10    0    12960364

CR_DT    DATE    4401109    7.29995744124812E-7    0    12960364

INDEX_NAME    UNIQUENESS    INI_TRANS    MAX_TRANS    BLEVEL    DISTINCT_KEYS    LEAF_BLOCKS    CLUSTERING_FACTOR    NUM_ROWS    SAMPLE_SIZE    AVG_LEAF_BLOCKS_PER_KEY    AVG_DATA_BLOCKS_PER_KEY

TAB1_CRDT    NONUNIQUE    20    255    4    4396763    21025300    119239900    1319549700    13195497    4    27

TAB1_UNQ    UNIQUE    20    255    4    1293957200    36146700    690771200    1293957200    12939572    1    1

Below is the Oracle sequence definition:-

Increment By    1

Last Cached Value    101941472795

Minimum Value    1

Maximum Value    999999999999999999999999999

Cache Size    10000

Cycle    No

Order    No

Below is the INSERT query:-

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

INSERT INTO TAB1 (FID, c2,c3, .......)   VALUES (SEQ1.NEXTVAL,

:1 ,     :2 ,        :3 ,          :4 ,  :5 ,         :6 ,    :7 ,   

:8 ,     :9 ,     :10 ,   :11 ,        :12 ,             :13 ,         

  :14 ,             :15 ,             :16 ,                  :17 ,     

          :18 ,              :19 ,            :20 ,       :21 ,      

:22 ,                    :23 ,      :24 ,     :25 ,     :26 , :27 )

Plan hash value: 2358401533

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

| Id  | Operation                | Name                  | Cost  |

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

|   0 | INSERT STATEMENT         |                       |     1 |

|   1 |  LOAD TABLE CONVENTIONAL |                       |       |

|   2 |   SEQUENCE               | SEQ1                  |       |

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

Query Block Name / Object Alias (identified by operation id):

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

   1 - INS$1

Note

-----

   - cpu costing is off (consider enabling it)

Below is the specific section of AWR report:-

Load Profile

Per SecondPer TransactionPer ExecPer Call
DB Time(s):  39.9  0.1  0.01  0.00
DB CPU(s):  6.0  0.0  0.00  0.00
Background CPU(s):  0.9  0.0  0.00  0.00
Redo size (bytes):  20,529,812.0  28,002.6
Logical read (blocks):  463,563.1  632.3
Block changes:  81,572.0  111.3
Physical read (blocks):  39,749.8  54.2
Physical write (blocks):  3,436.0  4.7
Read IO requests:  9,443.6  12.9
Write IO requests:  1,049.8  1.4
Read IO (MB):  310.6  0.4
Write IO (MB):  26.8  0.0
IM scan rows:
Session Logical Read IM:
Global Cache blocks received:  325.8  0.4
Global Cache blocks served:  3,211.2  4.4
User calls:  12,660.7  17.3
Parses (SQL):  1,935.9  2.6
Hard parses (SQL):  0.3  0.0
SQL Work Area (MB):  524.1  0.7
Logons:  1.0  0.0
Executes (SQL):  4,772.9  6.5
Rollbacks:  319.8  0.4
Transactions:  733.1

Instance Efficiency Percentages (Target 100%)

Buffer Nowait %:  99.69Redo NoWait %:  100.00
Buffer Hit %:  97.65In-memory Sort %:  100.00
Library Hit %:  100.00Soft Parse %:  99.99
Execute to Parse %:  59.44Latch Hit %:  99.56
Parse CPU to Parse Elapsd %:  75.30% Non-Parse CPU:  99.53
Flash Cache Hit %:  97.38

Top 10 Foreground Events by Total Wait Time

EventWaitsTotal Wait Time (sec)Wait Avg(ms)% DB timeWait Class
cell single block physical read32,163,21952.1K1.6236.5User I/O
enq: TX - index contention936,00830.3K32.4121.3Concurrency
DB CPU 21.5K 15.0
buffer busy waits4,073,33117.7K4.3412.4Concurrency
flashback buf free by RVWR14,6959068.6617.126.4Configuration
log file sync1,473,97045023.053.2Commit
read by other session311,2312499.78.031.8User I/O
enq: TX - allocate ITL entry23,7001091.346.05.8Configuration
direct path write temp25,006990.639.61.7User I/O
flashback log switch1,010792.4784.52.6Other

Wait Classes by Total Wait Time

Wait ClassWaitsTotal Wait Time (sec)Avg Wait (ms)% DB timeAvg Active Sessions
User I/O32,966,86557,0511.7340.016.0
Concurrency5,353,38748,1008.9933.713.5
System I/O2,768,57324,2948.7817.06.8
DB CPU 21,451 15.06.0
Configuration44,58210,767241.527.53.0
Other5,084,4535,1401.013.61.4
Commit1,474,0174,5023.053.21.3
Cluster3,558,8651,0280.29.70.3
Application24,85152721.22.40.1
Network39,227,3773190.01.20.1

Foreground Wait Class

  • s - second, ms - millisecond - 1000th of a second
  • ordered by wait time desc, waits desc
  • %Timeouts: value of 0 indicates value was < .5%. Value of null is truly 0
  • Captured Time accounts for 101.1% of Total DB time 142,720.85 (s)
  • Total FG Wait Time: 122,848.39 (s) DB CPU time: 21,451.22 (s)
Wait ClassWaits%Time -outsTotal Wait Time (s)Avg wait (ms)%DB time
User I/O32,804,259056,5491.7239.62
Concurrency5,124,017048,0899.3933.69
DB CPU 21,451 15.03
Configuration43,5861610,739246.397.52
Commit1,473,97004,5023.053.15
Other2,043,064791,3740.670.96
Cluster3,549,57501,0210.290.72
Application24,661052521.270.37
Network38,911,5820270.000.02
System I/O33,6590230.680.02

Back to Wait Events Statistics

Back to Top

Foreground Wait Events

  • s - second, ms - millisecond - 1000th of a second
  • Only events with Total Wait Time (s) >= .001 are shown
  • ordered by wait time desc, waits desc (idle events last)
  • %Timeouts: value of 0 indicates value was < .5%. Value of null is truly 0
EventWaits%Time -outsTotal Wait Time (s)Avg wait (ms)Waits /txn% DB time
cell single block physical read32,163,219 52,1361.6212.2736.53
enq: TX - index contention936,008 30,33432.410.3621.25
buffer busy waits4,073,331 17,6994.341.5512.40
flashback buf free by RVWR14,695459,069617.120.016.35
log file sync1,473,970 4,5023.050.563.15
read by other session311,231 2,5008.030.121.75
enq: TX - allocate ITL entry23,70001,09146.050.010.76
direct path write temp25,006 99139.610.010.69
flashback log switch1,01063792784.520.000.56
cell multiblock physical read73,845 5437.350.030.38
log file switch completion633 478755.490.000.34
enq: TX - row lock contention3,082 438142.070.000.31
gc cr block busy144,685 3992.760.060.28
block change tracking buffer space30860236767.160.000.17
cell smart table scan120,582342211.830.050.15
gc cr grant 2-way1,430,055 1530.110.550.11
gc buffer busy acquire202,724 1460.720.080.10
reliable message12,045 13411.090.000.09
cell list of blocks physical read32,488 1163.590.010.08
gc cr block 2-way552,859 850.150.210.06
enq: FB - contention51,166 791.550.020.06
gc current grant 2-way661,097 680.100.250.05
enq: SQ - contention3,834 5915.350.000.04
enq: KO - fast object checkpoint20,844 542.590.010.04
gc current block 2-way405,118 480.120.150.03
gc current block busy749 4763.390.000.03
enq: RO - fast object reuse677 3348.500.000.02
undo segment extension2889333113.640.000.02
latch: ges resource hash list259,195 310.120.100.02
gc buffer busy release1,25303024.190.000.02
cell smart index scan49,99818270.540.020.02
flashback free VI log363926719.970.000.02
SQL*Net message to client38,785,025 240.0014.800.02
gc current grant busy107,434 240.220.040.02
gcs drm freeze in enter server mode242 2395.480.000.02
control file sequential read33,655 220.650.010.02
library cache: mutex X28,862 190.670.010.01
cursor: pin S wait on X176 18104.170.000.01
enq: TX - contention3042929.380.000.01
enq: HW - contention431 819.630.000.01
name-service call wait202 735.480.000.01
gc remaster139 751.210.000.00
Disk file Mirror Read8,249 70.850.000.00

Wait Event Histogram

  • Units for Total Waits column: K is 1000, M is 1000000, G is 1000000000
  • % of Waits: value of .0 indicates value was <.05%; value of null is truly 0
  • % of Waits: column heading of <=1s is truly <1024ms, >1s is truly >=1024ms
  • Ordered by Event (idle events last)
% of Waits
EventTotal Waits <1ms <2ms <4ms <8ms<16ms<32ms <=1s  >1s
ADR block file read5240.4 1.948.19.6
ADR block file write10100.0
ADR file lock12100.0
ARCH wait for archivelog lock76100.0
ARCH wait on SENDREQ360389.310.1.0 .1.5
ASM file metadata operation15.3K96.32.6.3.0.0.1.3.4
CGS wait for IPC msg71K100.0
CSS initialization10250.0 38.211.8
CSS operation: action19091.18.9
CSS operation: query30697.12.9
DFS lock handle39398.2 1.5.3
Disk file Mirror Read78.9K64.214.812.27.9.6.2.1
Disk file operations I/O92.4K25.672.01.6.7.1.0.0
IPC send completion sync2902100.0
KJC: Wait for msg sends to complete11100.0
KSV master wait10.7K94.54.0.5.0.0.1.4.5
LGWR wait for redo copy1.2M99.9.1.0.0.0
LNS wait on SENDREQ310.1K99.9.0 .0.0.1.0
Log archive I/O52214.16.123.29.513.212.627.43.8
PX Deq Credit: free buffer406100.0
PX Deq: Signal ACK EXT324699.1.4.3.2.0
PX Deq: Signal ACK RSG324699.7.1.1.1.0
PX Deq: Slave Session Stats597396.01.2.51.8.4
PX Deq: reap credit70.4K100.0.0
PX qref latch1.2M100.0.0
Parameter File I/O193671.09.26.25.73.6.73.6
SGA: allocation forcing component growth812.5 87.5
SQL*Net break/reset to client50100.0
SQL*Net message to client38.8M100.0.0.0
SQL*Net more data from client117.1K100.0.0.0.0
SQL*Net more data to client974199.4.0.5.1
block change tracking buffer space3153.81.0.3.6.61.092.7
buffer busy waits4.1M86.85.63.32.0.7.31.3.0
buffer deadlock370.3K99.9.1.0.0
buffer exterminate639.6.5.21.397.5
cell list of blocks physical read32.6K47.515.517.414.43.51.0.6.0
cell multiblock physical read74K43.223.614.89.63.82.12.7.0
cell single block physical read32.1M77.112.95.73.0.7.2.3.0
cell smart index scan50.1K86.66.83.82.2.6.1.0
cell smart table scan120.9K87.55.03.42.21.0.5.5.0
change tracking file synchronous read801649.26.63.97.010.16.916.0.2
change tracking file synchronous write394650.418.98.03.94.44.310.1.1
control file parallel write560731.618.68.94.44.94.823.13.7
control file sequential read122.4K92.14.32.21.0.2.1.1.0
control file single write1258.3 8.3 8.316.78.3
cursor: mutex S6100.0
cursor: mutex X3100.0
Comments
Post Details
Added on Oct 21 2018
38 comments
10,588 views