TESB-10361 improve performance for SQL Server