I am using Heterogeneous query for Joining the 4 tables. The 2 DBs are :
(1) Oracle
(2) ODBC Generic - Informatica
The records present in these tables are huge. Now while executing the simple DML queries after joining these tables taking a lot of time(almost 4-5hrs) . Could you please let me know whether there is any limitations with number of records that should be used in heterogeneous queries or do you have any other ways or setttings to change to optimize the queries so that the output will come faster.
Number of records present in the tables are below:
Select * from TAR.VS_Leones.VT_DEAL_PRICING_B a, SRC.OCDW.FIN_ARR_PRICING_B b, SRC.OCDW.LOAN_B c, SRC.OCDW.TIME_B d
where
a.deal_id = c.LOAN_NUM and
b.FIN_ARR_ID = c.LOAN_ID and
d.curr_day_ind = ‘Y’ and b.record_type_cd=‘D’ and
d.calendar_dt between b.begin_dt and b.end_dt
There are a couple of things you can do with filters and subqueries to optimize this query. Please check out this white paper. Right now you have to change the query on your own but in future releases we are looking at doing some of these SQL rewrites for the user.
It also would be helpful to know which tables, table-1, table-2, table-3 and table-4 actually are. We may be able to further optimize with this knowledge.