There are 3 tables in SQL Server with large amount of data, each table contains about 100000 rows. There is one SQL to fetch rows from the three tables. Its performance is very bad. WITH t1 AS ( SELECT LeadId, dbo.get_item_id(Log) AS ItemId, DateCreated AS PriceDate FROM (SELECT t.ID, t.LeadID, t.Log, t.DateCreated, […]