What exactly is GUID? Why and where I should use it?

后端 未结 15 2083
走了就别回头了
走了就别回头了 2020-12-13 07:48

What exactly is GUID? Why and where I should use it?
I\'ve seen references to GUID in a lot of places, and in wikipedia, but it is not very clear telling you where to

15条回答
  •  有刺的猬
    2020-12-13 08:38

    GUID or UUID (globally vs Universally) Unique IDentifier is, well, a unique ID :) When you need something really unique machine generated, there are libraries to get you one.

    See GUID on wikipedia for details.

    As to when you don't need a GUID, it is when a counter that you control (one way or another, like a SERIAL SQL type or a sequence) gets incremented. Indexing a "text" value (GUID in textual form) or a 128 bit binary value (which a GUID is) is far more expensive than an integer.

提交回复
热议问题