I'm using EF and Dapper as ORMs. With some queries, I've optimized down to creating temporary tables like so:
Create Table #temp(FromUserId int, ToUserId int, FromAction int, ToAction int, IsMatch int)
My concern is - if I have a high number of users on my app all hitting this query at the same time, does each instance of the context get its own temp table?
Do I have to worry about naming the temp tables something unique (like the session ID?)
Usually my connections are made using something like the following from my service layer:
using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString)) {
Any help would be awesome.