We have one application in that we have 3 table in DB2 schema. I am using below query to fetch record. the transaction table may contain more than 1000000 records. I wrote below query to fetch data from multiple tables but it is taking more time than expectation of testers.
select * from (select ROW_NUMBER() OVER ( order by SOURCE_REFERENCE_NO,Trans_Date,Trans_Time,User_ID ) as RN ,Trans_Type from transaction t left join applicationref ar on t.code = ar.code
left join user u on u.username = t.useraccess left join user u1 on u1.username = t.username
)as w