When i run the below query in syb15 (with syb 12.5.X backward compatibilty) environment it runs 45min where as the same in syb12.5.1 it takes only 7-10min.
But the main thing is stld_date(in the below query) does not covered in the index of that table. Also main_table is a huge table. So is it because of index for that column? . Can any one please provide ur suggestion to
change the query so i can get the response very fast like 7-10min but witout creating index we have to get the quciker result.
Even i tried the SET FORCEPLAN ON option but not worked out.
----------------------------------------
select
co1,col2, col3,
col4, col5, col6,
col7, col8,col9
col10,col11,col12,col13,col14,col15,col16
from acct_table b(index idx_acct),
main_table m(index idx_main)
where b.acctno=m.acctno
and b.acctno like '00%'
and b.stld_date >= @curnt_date
and b.stld_date <= @end_date
--------------------------------------------------
whereas @curnt_date = current date
@end_date = current date + 8 days
acct_table has only acct nos(acct starts with 00 and 11 but we need only 00)
---------- Post updated at 01:30 PM ---------- Previous update was at 09:33 AM ----------
[/COLOR]Can any one please a solution from question