SELECT ccode, town, Date, Mortgage, Source, ParentCode as Lender, extrWeek, extrYear FROM TranMstr inner join Lookups!Lender on TranMstr.Lender=Lender.Code Inner Join SiteMstr on TranMstr.PropID=SiteMstr.PropID where between(mortgage,25000,500000) AND extrYear+extrWeek<=oJC.HighWeek and year(date)=val(oJC.CalYear) INTO TABLE (qry_arg3)And this is Rushmore optimization:
Using index tag Mortgage to rushmore optimize table tranmstr Using index tag Issueweek to rushmore optimize table tranmstr Using index tag Deleted to rushmore optimize table tranmstr Rushmore optimization level for table tranmstr: partial Rushmore optimization level for table lender: none Using index tag Deleted to rushmore optimize table sitemstr Rushmore optimization level for table sitemstr: full Joining table sitemstr and table tranmstr using index tag Propid Joining table lender and intermediate result using temp indexAs you can see, code and lender indexes are not used in optimization. This SQL runs extremely long...