- 最后登录
- 2015-5-21
- 在线时间
- 100 小时
- 威望
- 0
- 金钱
- 345
- 注册时间
- 2012-12-19
- 阅读权限
- 10
- 帖子
- 99
- 精华
- 0
- 积分
- 0
- UID
- 824
|
1#
发表于 2013-3-13 11:09:24
|
查看: 4754 |
回复: 3
本帖最后由 张沛 于 2013-3-13 11:32 编辑
- SELECT PID,
- a.completiontime,
- a.priority,
- a.inv_type,
- a.ifdel,
- DECODE (a.wip_type,
- 'PK', '派克',
- 'JZLT', '昆明忠金立泰科技有限公司',
- 'HS', '豪胜',
- 'SH', '松浩',
- '无')
- wip_type,
- SIGN (
- NVL (COMPLETIONTIME, SYSDATE)
- - NVL (e.last_update_date, SYSDATE))
- overdue,
- b.planflag
- FROM LS_WIP_HEADERS a
- LEFT OUTER JOIN ls_wip_lines b
- ON a.pid = b.headerid
- LEFT OUTER JOIN acedev.ls_order_headers c
- ON b.eheaderid = c.header_id
- LEFT OUTER JOIN acedev.ls_order_lines d
- ON b.elineid = d.line_id AND c.header_id = d.header_id
- LEFT OUTER JOIN ( SELECT DISTINCT
- header_id,
- line_id,
- prod_proc_type_id,
- MAX (last_update_date) last_update_date
- FROM acedev.LS_WIP_PROD_PROC
- GROUP BY header_id, line_id, prod_proc_type_id) e
- ON b.headerid = e.header_id
- AND b.lineid = e.line_id
- AND e.prod_proc_type_id =
- DECODE (a.inv_type, '导轨', 7, 12)
- WHERE b.state = 1 AND a.flag IN (1, 4)
- UNION ALL
- SELECT PID,
- NO,
- a.completiontime,
- a.priority,
- a.inv_type,
- a.ifdel,
- DECODE (a.wip_type,
- 'PK', '派克',
- 'JZLT', '昆明忠金立泰科技有限公司',
- 'HS', '豪胜',
- 'SH', '松浩',
- '无')
- wip_type,
- SIGN (
- NVL (COMPLETIONTIME, SYSDATE)
- - NVL (e.last_update_date, SYSDATE))
- overdue,
- b.planflag
- FROM LS_WIP_HEADERS a
- LEFT OUTER JOIN ls_wip_lines b
- ON a.pid = b.headerid
- LEFT OUTER JOIN acedev.lsv_gongdan2 c
- ON b.makeno = c.makeno AND b.fnumber = c.ordered_item
- LEFT OUTER JOIN ( SELECT DISTINCT
- header_id,
- line_id,
- prod_proc_type_id,
- MAX (last_update_date) last_update_date
- FROM acedev.LS_WIP_PROD_PROC
- GROUP BY header_id, line_id, prod_proc_type_id) e
- ON b.headerid = e.header_id
- AND b.lineid = e.line_id
- AND e.prod_proc_type_id =
- DECODE (a.inv_type, '导轨', 7, 12)
- WHERE b.state = 1 AND a.flag IN (2, 3)
-
复制代码 在结尾添加上一个条件 and NO = 'YM4404'后反应时间很慢-
- -----------------------------------------------------------------------------------------------------
- | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)|
- -----------------------------------------------------------------------------------------------------
- | 0 | SELECT STATEMENT | | 2 | 12500 | | 27335 (1)|
- | 1 | VIEW | LSV_WIP_SEARCH | 2 | 12500 | | 27335 (1)|
- | 2 | UNION-ALL | | | | | |
- | 3 | NESTED LOOPS OUTER | | 1 | 3998 | | 1354 (2)|
- |* 4 | HASH JOIN OUTER | | 1 | 3958 | | 1352 (2)|
- | 5 | VIEW | | 1 | 3910 | | 9 (0)|
- | 6 | NESTED LOOPS OUTER | | 1 | 153 | | 9 (0)|
- | 7 | NESTED LOOPS | | 1 | 132 | | 7 (0)|
- |* 8 | TABLE ACCESS BY INDEX ROWID| LS_WIP_HEADERS | 1 | 69 | | 4 (0)|
- |* 9 | INDEX RANGE SCAN | LS_WIP_HEADERS_U1 | 1 | | | 3 (0)|
- |* 10 | TABLE ACCESS BY INDEX ROWID| LS_WIP_LINES | 1 | 63 | | 3 (0)|
- |* 11 | INDEX RANGE SCAN | LS_WIP_LINES_PK | 6 | | | 2 (0)|
- | 12 | TABLE ACCESS BY INDEX ROWID | LS_ORDER_HEADERS | 1 | 21 | | 2 (0)|
- |* 13 | INDEX UNIQUE SCAN | P_HEADER_ID | 1 | | | 1 (0)|
- | 14 | VIEW | | 178K| 8388K| | 1341 (2)|
- | 15 | HASH GROUP BY | | 178K| 3495K| 10M| 1341 (2)|
- | 16 | TABLE ACCESS FULL | LS_WIP_PROD_PROC | 178K| 3495K| | 240 (3)|
- |* 17 | TABLE ACCESS BY INDEX ROWID | LS_ORDER_LINES | 1 | 40 | | 2 (0)|
- |* 18 | INDEX UNIQUE SCAN | LSPK_LINE_ID | 1 | | | 1 (0)|
- |* 19 | HASH JOIN OUTER | | 1 | 6478 | | 25981 (1)|
- | 20 | VIEW | | 1 | 6430 | | 24638 (1)|
- |* 21 | HASH JOIN OUTER | | 1 | 3949 | | 24638 (1)|
- |* 22 | TABLE ACCESS BY INDEX ROWID | LS_WIP_LINES | 1 | 43 | | 3 (0)|
- | 23 | NESTED LOOPS | | 1 | 112 | | 7 (0)|
- |* 24 | TABLE ACCESS BY INDEX ROWID| LS_WIP_HEADERS | 1 | 69 | | 4 (0)|
- |* 25 | INDEX RANGE SCAN | LS_WIP_HEADERS_U1 | 1 | | | 3 (0)|
- |* 26 | INDEX RANGE SCAN | LS_WIP_LINES_PK | 6 | | | 2 (0)|
- | 27 | VIEW | LSV_GONGDAN2 | 317K| 1160M| | 24627 (1)|
- | 28 | HASH GROUP BY | | 317K| 37M| 81M| 24627 (1)|
- |* 29 | HASH JOIN RIGHT OUTER | | 317K| 37M| 5912K| 15788 (1)|
- | 30 | TABLE ACCESS FULL | LS_MATERIEL_ITEM | 120K| 4489K| | 1249 (1)|
- |* 31 | HASH JOIN OUTER | | 317K| 26M| 17M| 12773 (1)|
- |* 32 | HASH JOIN RIGHT OUTER | | 317K| 13M| 9184K| 4736 (1)|
- | 33 | TABLE ACCESS FULL | LS_ORDER_HEADERS | 247K| 6282K| | 2621 (1)|
- | 34 | TABLE ACCESS FULL | LS_ORDER_LISTS | 317K| 6192K| | 1180 (1)|
- | 35 | TABLE ACCESS FULL | LS_ORDER_LINES | 593K| 22M| | 5690 (1)|
- | 36 | VIEW | | 178K| 8388K| | 1341 (2)|
- | 37 | HASH GROUP BY | | 178K| 3495K| 10M| 1341 (2)|
- | 38 | TABLE ACCESS FULL | LS_WIP_PROD_PROC | 178K| 3495K| | 240 (3)|
- -----------------------------------------------------------------------------------------------------
-
- Predicate Information (identified by operation id):
- ---------------------------------------------------
-
- 4 - access("E"."PROD_PROC_TYPE_ID"(+)=DECODE("from$_subquery$_006"."INV_TYPE",'导轨',7,12)
- AND "from$_subquery$_006"."LINEID"="E"."LINE_ID"(+) AND
- "from$_subquery$_006"."HEADERID"="E"."HEADER_ID"(+))
- 8 - filter("A"."FLAG"=1 OR "A"."FLAG"=4)
- 9 - access("A"."NO"='YM4404')
- 10 - filter("B"."STATE"=1)
- 11 - access("A"."PID"="B"."HEADERID")
- 13 - access("B"."EHEADERID"="C"."HEADER_ID"(+))
- 17 - filter("C"."HEADER_ID"="D"."HEADER_ID"(+))
- 18 - access("B"."ELINEID"="D"."LINE_ID"(+))
- 19 - access("E"."PROD_PROC_TYPE_ID"(+)=DECODE("A"."INV_TYPE",'导轨',7,12) AND
- "B"."LINEID"="E"."LINE_ID"(+) AND "B"."HEADERID"="E"."HEADER_ID"(+))
- 21 - access("B"."FNUMBER"="C"."ORDERED_ITEM"(+) AND "B"."MAKENO"="C"."MAKENO"(+))
- 22 - filter("B"."STATE"=1)
- 24 - filter("A"."FLAG"=2 OR "A"."FLAG"=3)
- 25 - access("A"."NO"='YM4404')
- 26 - access("A"."PID"="B"."HEADERID")
- 29 - access("LINE"."ORDERED_ITEM"="ITEM"."FNUMBER"(+))
- 31 - access("LIST"."LINE_ID"="LINE"."LINE_ID"(+) AND
- "LIST"."HEAD_ID"="LINE"."HEADER_ID"(+))
- 32 - access("LIST"."HEAD_ID"="HEAD"."HEADER_ID"(+))
-
复制代码 没有and NO = 'YM4404'这个条件的执行计划,字数超了,贴在下面了
请问各位大师这是怎么回事?有没有好的方法能够让加调价的快一下,原先不加不到10秒出结果,加了条件接近1分钟才出结果
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi olap |
|