5个原始表
select count(1) from fwwiphistory 33882115
select count(1) from fwwiptransaction 33878689
select count(1) from FwWipHistory_N2M 33881057
select count(1) from FwWipStepHistory 33567057
select count(1) from FwComment 5558519
数字为记录数
还有个视图如下,查询起来特别慢,怎么才能提高查询的速度
create or replace view jsmc.v_cycletime_wip as
select fps.wipid,
fps.planid,
fps.productid,
substr(fph.stepid, 1, instr(fph.stepid, '.') - 1) stepid,
fph.handle,
fps.lottype,
fpn.txntimestamp,--??Out
fpn.trackintime,--??In
fpn.lasttrackout,--??Out
round(to_date(substr(fpn.txntimestamp, 0, 8) ||
substr(fpn.txntimestamp, 10, 6),
'yyyy/mm/dd hh24:mi:ss') -
to_date(substr(fpn.trackintime, 0, 8) ||
substr(fpn.trackintime, 10, 6),
'yyyy/mm/dd hh24:mi:ss'),
8) *24* 60 HourCostCur,--??Out-??In
round(to_date(substr(fpn.trackintime, 0, 8) ||
substr(fpn.trackintime, 10, 6),
'yyyy/mm/dd hh24:mi:ss') -
to_date(substr(fpn.lasttrackout, 0, 8) ||
substr(fpn.lasttrackout, 10, 6),
'yyyy/mm/dd hh24:mi:ss'),
8) *24* 60 HourCostLast--??In-??Out
from fwwiptransaction fpn,
fwwiphistory fps,
fwwiphistory_n2m fpsn,
fwwipstephistory fph
where fpn.sysid = fps.wiptxn
and fps.sysid = fpsn.fromid
and fph.sysid = fpsn.toid
and fpn.activity in ('TrackOut');
------解决思路----------------------
提供你查询慢的SQL及其执行计划。