什么是最大值.Facebook uid 的长度? [英] What's the max. length of a Facebook uid?

查看:20
本文介绍了什么是最大值.Facebook uid 的长度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我见过多种尺寸,我不想在 MySQL 字段上浪费服务器内存,因为它为太多字符保留了太多空间.他们能得到的最大的东西是多少?这种情况会改变吗?

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?

推荐答案

这就是整数溢出、整数->字符串迁移等发生的原因,原因是数据类型过于严格.为 128b varchar 分配几个字节,省去以后的麻烦.如果您的用户群如此庞大,以至于您需要担心通过处理 UID 数据类型会节省多少字节,那么请认为自己取得了巨大的成功,这是一个您很乐意解决的问题.

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.

简短的回答,我认为没有人能够回答您的问题,永远"是很长一段时间,谁知道届时 facebook 将奴役多少实体.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆