.NET Core REST API with EF 6.1.3 runs on net452 as targetFramework, takes minutes to execute a Procedure and return the results to model, but with same SP parameters it takes only a second to execute in SSMS 17. Its a SQL Server 2016 DB with few encrypted columns and have 30k+ records (DEV).
Initially I was getting SQL timeout - now fixed by having connection timeout in the appsettings.DEV.json, also increased command timeout to infinite by having below on the constructor of the context:
var adapter = (IObjectContextAdapter)this; var objectContext = adapter.ObjectContext; objectContext.CommandTimeout = 0 * 60;
In SSMS 17, turned OFF - SET ARITHABORT to reproduce this slowness but could not reproduce - it executes in a second with/without ARITHABORT flag. SP does only SELECT (since it has AE columns, only equality conditions are performed on it)