I’m guessing whether it’s better to calculate hash values for SQL tables with partition elimination in SQL or C#. E.G. for a dbo.Users
table we could calculate the hash value of UserId
in SQL:
DECLARE @hashValue tinyint = CONVERT(tinyint, (@UserId % 16) + 1)
Which would be the benefits of running this directly on SQL Server or calculating it on the web server and then pass the value to the query? P.S. Let’s assume this query runs thousand of times per minute.