SQL电子邮件字段应保留多长时间? [英] How long should SQL email fields be?

查看:135
本文介绍了SQL电子邮件字段应保留多长时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认识到电子邮件地址基本上可以无限期地长,因此我在varchar电子邮件地址字段中加上的任何大小都将是任意的。但是,我想知道标准是什么?你们做多久了? (对姓名字段的问题相同...)

I recognize that an email address can basically be indefinitely long so any size I impose on my varchar email address field is going to be arbitrary. However, I was wondering what the "standard" is? How long do you guys make it? (same question for Name field...)

更新:显然,电子邮件地址的最大长度为320(< = 64名称)部分,< = 255域)。

update: Apparently the max length for an email address is 320 (<=64 name part, <= 255 domain). Do you use this?

推荐答案

理论上的限制很长,但是您是否真的需要担心这些长电子邮件地址?如果某人无法使用100字符的电子邮件登录,您真的在乎吗?我们实际上更希望它们不能。

The theoretical limit is really long but do you really need worry about these long Email addresses? If someone can't login with a 100-char Email, do you really care? We actually prefer they can't.

一些统计数据可能会阐明这个问题。我们分析了一个拥有超过1000万个电子邮件地址的数据库。这些地址未确认,因此无效。以下是一些有趣的事实,

Some statistical data may shed some light on the issue. We analyzed a database with over 10 million Email addresses. These addresses are not confirmed so there are invalid ones. Here are some interesting facts,


  1. 最长的有效时间是89。

  2. 还有几百个更长的时间达到我们的列数上限(255)的那些,但通过目视检查它们显然是假的。

  3. 长度分布的峰值为19。

  4. 没有长尾巴。 38之后,一切都会急剧下降。

  1. The longest valid one is 89.
  2. There are hundreds longer ones up to the limit of our column (255) but they are apparently fake by visual inspection.
  3. The peak of the length distribution is at 19.
  4. There isn't long tail. Everything falls off sharply after 38.

我们清理掉了超过40岁的数据,清理了数据库。好消息是,没有人抱怨了,但坏消息是没有很多记录被清除。

We cleaned up the DB by throwing away anything longer than 40. The good news is that no one has complained but the bad news is not many records got cleaned out.

这篇关于SQL电子邮件字段应保留多长时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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