0

我目前正在使用 UUID v1 作为唯一 ID

但是,我认为 uuid 太长了

我想生成像 fb 和 G+ 这样更短的数字唯一 ID

并且不必在插入之前检查 id 是否存在于数据库中

例子:

https://plus.google.com/104560124403688998123/posts

脸书/100001458264256

我正在考虑根据一些用户详细信息生成它?

有什么好主意吗?

4

1 回答 1

0

It would make more sense to simply have this be the (auto increment/numeric) identity column on the main user record. To have it of a similar length you'll need to start your auto increment value at 100000000 or something of the sort. You'll also need to make sure the column is wide enough to hold numbers of that size and up for more users than you think you'll have.

于 2013-04-22T15:39:46.583 回答