整张表大约2亿行数据,要删除大约60%多数据,现在删除非常慢,大约200多条/秒,做了10046事件,如下:

能看出大概是什么导致这么慢么?

DELETE FROM xxxxx

WHERE

xxxxx.时间 < sysdate - 180 AND ROWNUM <= 10000

call     count       cpu    elapsed       disk      query    current        rows

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

Parse        1      0.00       0.00          0          0          0           0

Execute      1      5.94      37.25       7633      11264     585841       10000

Fetch        0      0.00       0.00          0          0          0           0

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

total        2      5.95      37.25       7633      11264     585841       10000

Misses in library cache during parse: 1

Optimizer mode: RULE

Parsing user id: 59

Rows     Row Source Operation

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

0  DELETE  xxxxx (cr=11264 pr=7633 pw=0 time=37251107 us)

10000   COUNT STOPKEY (cr=11192 pr=54 pw=0 time=213607 us)

10000    INDEX RANGE SCAN xxxxx (cr=11192 pr=54 pw=0 time=193642 us)(object id

123938)

Elapsed times include waiting on following events:

Event waited on                             Times   Max. Wait  Total Waited

----------------------------------------   Waited  ----------  ------------

undo segment extension                          1        0.00          0.00

db file sequential read                      7633        0.05         31.79

SQL*Net message to client                       1        0.00          0.00

SQL*Net message from client                     1        0.02          0.02

********************************************************************************

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐