I must store few million 128-bit hash values to the database and I am struggling with my table design.
Should I store hash in two BIGINT fields or just use BINARY(16)? My typical use case is to find duplicate records based on hash.
I could just use (with two bigints)
select * from hash where hash1=@hash1 and hash2=@hash2
or (with binary(16) column)
select * from hash where hash=@hash
Does it matter performance wise?
I am using MS SQL Server but I don't think it is important here. However, I am accessing MS SQL from C# program and easy read/write of values is preferred but not a deal breaker. Currently I have an array of ulong.