I am using Azure SQL
database in my project and in which some same set of queries are being executed very frequently.
Recently I received a performance recommendation saying - Non-Parameterized queries are causing performance issues
. and are suggesting to execute the following statement in my database.
ALTER DATABASE [TestDB] SET PARAMETERIZATION FORCED
I came to know that Forced parameterization may improve the performance of certain databases by reducing the frequency of query compilations and recompilation. Also, it is known that stored procedures are executable code and are automatically cached and shared among user and it can prevent recompilations.
Please help me with below-listed questions.
1)Do turning database into Forced PARAMETERIZATION would work better than making frequently used queries into stored procedures?
2)Is it safe performing the Forced Parameterization option in my database?