什么是最大Facebook uid的长度? [英] What's the max. length of a Facebook uid?
问题描述
这是整数溢出,整数 - >字符串迁移等发生,通过使数据类型太限制。为128b的varchar发出几个字节的闪存,并为您节省下来的麻烦。如果您的用户群如此庞大,您需要担心通过处理UID的数据类型可以节省多少字节,请考虑自己的巨大成功,这是您将很乐意解决的问题。
$ b简单的回答,我不认为任何人都能够回答你的问题,永远是很长一段时间,谁知道Facebook将被奴役多少实体。我会以最好的方式报价;
我们应该忘记小的效率,约97%的时间:过早的优化是所有邪恶的根源。
-Donald E. Knuth
I've seen multiple sizes and I don't want to waste server memory on a MySQL field which is reserving too much space for too many characters. What's the biggest they can get and will this ever change?
This is how integer overflows, integer->string migrations etc happen, by making datatypes too restrictive. Splash out on a few bytes for a 128b varchar and save yourself the hassle down the road. If your user base gets so massive that you need to be worrying about how many bytes you will save by crunching data types of UIDs, consider yourself a huge success and that is a problem you will be happy to solve.
Short answer, I dont think anyone will be able to answer your question, "ever" is a long time and who knows how many entities facebook will have enslaved by then.
I'll end with a quote from one who said it best;
We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil.
—Donald E. Knuth
这篇关于什么是最大Facebook uid的长度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!