Solved

Query slow over Dblink.

Posted on 2013-11-19
2
440 Views
Last Modified: 2013-11-20
Hi all,

When I am trying to execute the below query, it is very slow(1 to 2 mins), but that not happens everytime, like once in 5 or 6 times.

SELECT SUM(NVL(TOT_NO_PKGS,0))
        FROM MQ_DPC_PKGS MDP,
             MQ_DPC_BOES MDB
       WHERE MDP.DOC_NO    = MDB.DOC_NO
         AND MDP.BILL_NO   = MDB.BILL_NO
         AND MDB.BILL_NO = '303-00006116-13'
         AND REC_TYPE      = 'I'
   AND NVL (MDP.DEL_IND, 'N') = 'N'

table MQ_DPC_PKGS is from remote DB. Help me to find out reason / solution.
query-cost.jpg
0
Comment
Question by:sakthikumar
2 Comments
 
LVL 76

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 250 total points
ID: 39659245
Check the query/plan from the remote database.

Also try monitoring network usage when it is slow.
0
 
LVL 13

Accepted Solution

by:
magarity earned 250 total points
ID: 39661339
Your query specifies one particular BILL_NO on the local table but not on the remote table. The optimizer may be translating that to a table scan on the remote.  I suggest either:
1) switch the BILL_NO to the remote table: MDP.BILL_NO = '303-00006116-13' (instead of MDB.BILL_NO =)
OR
2) move the query processing to the remote server with the 'driving_site' hint, see the Oracle documentation here: http://docs.oracle.com/cd/B10501_01/server.920/a96533/hintsref.htm#5699
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now