EF Primary Key - int, uint, long or ulong?
I want to hold lots and lots of rows in my Postgres database. I assume I would be best advised configuring my entities and migrations to use a ulong as the Primary Key?
8 Replies
if you can store 18_446_744_073_709_551_615; Or in words: eighteen quintillion four hundred forty-six quadrillion seven hundred forty-four trillion seventy-three billion seven hundred nine million five hundred fifty-one thousand six hundred fifteen; elements in your database, sure go for it
But I'd reckon 2 Billion (int32) would also do the trick
Also mind, something like unsigned integers are special and not many languages have them; Java (doesnt integrate nicely), PHP, JavaScript for example dont have them
ew really
Which limits your db to only be used by C# in practice, which ehhh
I already use ulong in other places so
that ship has sailed
lol
iirc, discord's snowflakes fit into ulong's, but they're shipped as strings in json; Cuz many languages couldnt deserialize them
ulong it is then I guess xD
Thanks for the input