Home » RDBMS Server » Performance Tuning » Full table scan (Oracle 11g)
Full table scan [message #653792] |
Tue, 19 July 2016 02:15 |
|
samiran_cts
Messages: 52 Registered: January 2012
|
Member |
|
|
Hello,
I have one archive script where the source and the archive database are in different database. So I used DB link to access data. Now this script was working fine for 1 year suddenly one issue arises. In the script there is a situation where it is required to get the child cases. So there is a query used:
merge into sm_arch.sm_archive_stg s
using (
select pxcoverinskey
,pzInskey
,pxcoveredcount
,pyresolvedtimestamp
,pxupdatedatetime
,pxobjclass
from prpc_app.sm_work@DBLNK_GSMARCH.GTI.WHEM.test.NET
where pxcoverinskey in (
select pzInskey
from sm_arch.sm_archive_stg
where pxcoveredcount > 0
)
) h
ON (s.pzInskey = h.pzInskey)
when not matched then
insert (pxcoverinskey
,pzinskey
,pxcoveredcount
,pyresolvedtimestamp
,pxupdatedatetime
,createdatetime
,pxobjclass)
values(h.pxcoverinskey
,h.pzinskey
,h.pxcoveredcount
,h.pyresolvedtimestamp
,h.pxupdatedatetime
,sysdate
,h.pxobjclass);
But in the AWR report Oracle modifies the query on the remote site as
SELECT
PXCOVERINSKEY","PXCOVEREDCOUNT","PXOBJCLASS","PXUPDATEDATETIME","PYRESOLVEDTIMESTAMP","PZINSKEY" FROM "PRPC_APP"."SM_WORK" "SM_WORK" WHERE "PXCOVERINSKEY" IS NOT NULL
I have modified the inside sub query by joining
select pxcoverinskey
,pzInskey
,pxcoveredcount
,pyresolvedtimestamp
,pxupdatedatetime
,pxobjclass
from prpc_app.sm_work@DBLNK_GSMARCH.GTI.WHEM.test.NET
where pxcoverinskey in (
select pzInskey
from sm_arch.sm_archive_stg
where pxcoveredcount > 0
)
by
SELECT DSH.pxcoverinskey,
DSH.pzInskey,
DSH.pxcoveredcount,
DSH.pyresolvedtimestamp,
DSH.pxupdatedatetime,
DSH.pxobjclass
FROM PRPC_APP.SM_WORK@DBLNK_GSMARCH.GTI.WHEM.test.NET DSH ,
SM_ARCH.SM_ARCHIVE_STG stg
WHERE dsh.pxcoverinskey = stg.pzInskey
AND stg.pxcoveredcount > 0
But still the same problem arises in the AWR report. How to modify the query so to avoid the problem. I have also used the driving site hint but didn't help.
|
|
|
|
|
|
Could you tell me ... [message #659013 is a reply to message #653792] |
Wed, 04 January 2017 03:19 |
|
wanear
Messages: 8 Registered: December 2016
|
Junior Member |
|
|
hi,
could you tell me
1.how many rows does this sql returns
select pxcoverinskey
,pzInskey
,pxcoveredcount
,pyresolvedtimestamp
,pxupdatedatetime
,pxobjclass
from prpc_app.sm_work@DBLNK_GSMARCH.GTI.WHEM.test.NET
where pxcoverinskey in (
select pzInskey
from sm_arch.sm_archive_stg
where pxcoveredcount > 0
)
2. the size of sm_arch.sm_archive_stg and prpc_app.sm_work@DBLNK_GSMARCH.GTI.WHEM.test.NET
3.and this sql plan
3.1 you can explain plan for select pxcoverinskey
,pzInskey
,pxcoveredcount
,pyresolvedtimestamp
,pxupdatedatetime
,pxobjclass
from prpc_app.sm_work@DBLNK_GSMARCH.GTI.WHEM.test.NET
where pxcoverinskey in (
select pzInskey
from sm_arch.sm_archive_stg
where pxcoveredcount > 0
);
3.2 select * from table(dbms_xplan.display);
[SPLIT from an unrelated topic by LF]
[LF MERGED it back, after seeing BB's message]
[Updated on: Thu, 05 January 2017 03:31] by Moderator Report message to a moderator
|
|
|
|
|
|
|
Goto Forum:
Current Time: Thu Jan 30 16:42:16 CST 2025
|