Speed up by adding an index to dbo.InstallmentHistory.