Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Query with join to be run on linked server - how to?

822262Mar 10 2011 — edited Mar 10 2011
Hi,

Maybe it's a stupid question but I'm stucked.
I need to run a simple query on linked database. The query links two tables which a re quite large. Example of how the query looks like:
select
    atab.field_1
  , btab.field_2
from
    TABLE_A atab
  join
    TABLE_B btab on btab.field_1 = atab.field_1
where
    btab.field_3 = 'SAMPLE'
When run directly on remote database it runs very quickly since indexes are used. When run thtough link it becomes very slow since apparently indexes are not used:
select
    atab.field_1
  , btab.field_2
from
    TABLE_A@REMOTE atab
  join
    TABLE_B@REMOTE btab on btab.field_1 = atab.field_1
where
    btab.field_3 = 'SAMPLE'
Is there any way to run a full query on linked database?

I'm not allowed to create views on remote database which would be obvious solution :-(

Any help appreciated

Zbig
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 7 2011
Added on Mar 10 2011
2 comments
482 views