为什么不总是使用GUID而不是整数ID? [英] Why not always use GUIDs instead of Integer IDs?

查看:85
本文介绍了为什么不总是使用GUID而不是整数ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用GUID有什么缺点?
为什么不默认使用它们?

解决方案

整数加入速度要快一点。这在处理数百万行时尤其重要。



对于两个,GUID占用的空间大于整数。另外,在处理数百万行时,非常重要。



对于三个,GUID有时会采用不同的格式,可能导致应用程序中的打嗝等。整数是一个整数,通过并通过。



可以找到更深入的内容这里,以及 Jeff的博客


What are the disadvantages of using GUIDs? Why not always use them by default?

解决方案

Integers join a lot faster, for one. This is especially important when dealing with millions of rows.

For two, GUIDs take up more space than integers do. Again, very important when dealing with millions of rows.

For three, GUIDs sometimes take different formats that can cause hiccups in applications, etc. An integer is an integer, through and through.

A more in depth look can be found here, and on Jeff's blog.

这篇关于为什么不总是使用GUID而不是整数ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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