Simple query using group clause for 1 million records resulting
in final list of 27 records.
First time takes 0.43053775 secs.
Same query through Stored procedure: First time takes 0.43341600 secs.
So in terms of time, first time they are very close.
Profiling comparison for both can be seen in below figure no_cache_comparison.png where left one is simple inline query and right one is stored procedure query.
There are some actions which …