We are floating a new scalable and performance-centric ASP.Net application in our organization which is currently in design phase.
The managers have decided taking a hybrid approach. They have decided to use CLR stored procedures extensively while T-SQL only for simple data manipulations.
I would like to know the following from the community:
- Whether there can be performance issues at a later stage with so many CLR stored procedures?
- If you had any performance issues, was there a fix available from the MS team?
Note: I did a google and found following most probable issues, haven't found a resolution for the first two though.
When SQL Server loads assemblies, they are cached in memory. When the O/S signals memory pressure to SQL Server, explicit garbage collection may be run, and the assemblies may be unloaded. This can cause performance issues if it happens frequently.
SQL CLR code cannot be costed accurately by the query optimiser, as it does not look at what the code actually does – this can affect execution plans.
SQL CLR code can sometimes prevent parallelism as they are usually single threaded. Sometimes this can hurt performance. << Although I found a solution to this here Multi-threaded code in CLR Stored Procs? >>
Let me know of issues and fixes with CLR stored procedures.