Facebook user_id : big_int, int or string?

前端 未结 8 974
忘掉有多难
忘掉有多难 2020-12-13 08:41

Facebook\'s user id\'s go up to 2^32 .. which by my count it 4294967296.

mySQL\'s unsigned int\'s range is 0 to 4294967295 (which is 1 short - or my math is wrong) a

8条回答
  •  眼角桃花
    2020-12-13 09:07

    I would just stick with INT. It's easy, it's small, it works and you can always change the column to a larger size in the future if you need to.

    FYI:

    VARCHAR(n) ==> variable, up to n + 1 bytes
    CHAR(n) ==> fixed, n bytes

提交回复
热议问题