I have a table of user ids that is huge.
I have an array of user ids that I want.
I have two tables that have a foreign user id key.
What is the best way to get this information performance wise?
Ideally in SQL the final result would be somewhat like this (null values if there is no user ID in one table but not the other):
userid table1value table2value
1 null 12
5 123 null
I was having the same issue last year and then when it came to performance, then instead of taking temp table for holding records (application end or service end) O moved to LINQ to SQL and made a stored procedure and called it through entities like LINQ to stored procedure =). And my stored procedure did all and returned only those records that I wanted and I did paging to at the stored procedure end so that I got limited data at a time rather than all data at application.
Do let me know if you need any help in that. I will give a code snippet too.