Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Universally unique identifier
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Uses == === Filesystems === Significant uses include [[ext2]]/[[ext3]]/[[ext4]] filesystem userspace tools ([[e2fsprogs]] uses libuuid provided by [[util-linux]]), [[Logical Volume Manager (Linux)|LVM]], [[LUKS]] encrypted partitions, [[GNOME]], [[KDE]], and [[macOS]],<ref>[https://opensource.apple.com/source/Libc/Libc-391/uuid/uuidsrc/gen_uuid.c gen_uuid.c in Apple's Libc-391, corresponding to Mac OS X 10.4]</ref> most of which are derived from the original implementation by [[Theodore Ts'o]].<ref name="e2fsprogs">{{cite web|url=https://git.kernel.org/?p=fs/ext2/e2fsprogs.git;a=blob;f=lib/uuid/gen_uuid.c;hb=1bbfec624c4bbe767060a13762aa9a656536a4fd|title=ext2/e2fsprogs.git - Ext2/3/4 filesystem userspace utilities|website=Kernel.org|access-date=9 January 2017}}</ref> The "partition label" and the "partition UUID" are both stored in the [[Superblock (file system)|superblock]]. They are both part of the file system rather than of the partition. For example, ext2β4 contain a UUID, while NTFS or FAT32 do not. The superblock is a part of the file system, thus fully contained within the partition, hence doing {{code|1=dd if=/dev/sda1 of=/dev/sdb1}} leaves both sda1 and sdb1 with the same label and UUID. === Partition tables === The [[GUID Partition Table]] (GUID) is one example that utilised GUIDs to label partition types. === Remoting === There are several flavors of GUIDs used in Microsoft's [[Component Object Model]] (COM): * {{mono|IID}} β interface identifier; (The ones that are registered on a system are stored in the [[Windows Registry]] at {{code|[HKEY_CLASSES_ROOT\Interface]}}<ref>{{cite web|url=https://msdn.microsoft.com/en-us/library/windows/desktop/ms688484(v=vs.85).aspx|title=Interface Pointers and Interfaces|website=Windows Dev Center - Desktop app technologies|publisher=[[Microsoft]]|access-date=15 December 2015|quote=You reference an interface at run time with a globally unique interface identifier ({{mono|IID}}). This {{mono|IID}}, which is a specific instance of a globally unique identifier ({{mono|GUID}}) supported by COM, allows a client to ask an object precisely whether it supports the semantics of the interface, without unnecessary overhead and without the confusion that could arise in a system from having multiple versions of the same interface with the same name.}}</ref> ) * {{mono|CLSID}} {{anchor|CLSID}} β class identifier; (Stored at {{code|[HKEY_CLASSES_ROOT\CLSID]}}). In practice it is not entirely separate from the {{mono|IID}} space, because remoting the interface can require a [[Stub (distributed computing)|proxy/stub object]] which some toolsets used to create with a {{mono|CLSID}} equal to the interface's {{mono|IID}}. * {{mono|LIBID}} β type library identifier; (Stored at {{code|[HKEY_CLASSES_ROOT\TypeLib]}}<ref>{{cite web|url=https://msdn.microsoft.com/en-us/library/windows/desktop/ms221610(v=vs.85).aspx|title=Registering a Type Library|website=[[Microsoft Developer Network]]|publisher=[[Microsoft]]|access-date=15 December 2015}}</ref>) * {{mono|CATID}} β category identifier; (its presence on a class identifies it as belonging to certain class categories, listed at {{code|[HKEY_CLASSES_ROOT\Component Categories]}}<ref>{{cite web|url=https://msdn.microsoft.com/en-us/library/windows/desktop/ms682451(v=vs.85).aspx|title=Categorizing by Component Capabilities|website=Windows Dev Center - Desktop app technologies|publisher=[[Microsoft]]|access-date=15 December 2015|quote=A listing of the CATIDs and the human-readable names is stored in a well-known location in the registry.}}</ref>) === Databases === UUIDs are commonly used as a [[unique key]] in [[database]] tables. The {{mono|NEWID}} function in [[Microsoft SQL Server]] version 4 [[Transact-SQL]] returns standard random version-4 UUIDs, while the {{mono|NEWSEQUENTIALID}} function returns 128-bit identifiers similar to UUIDs which are committed to ascend in sequence until the next system reboot.<ref>{{cite web |url=http://msdn.microsoft.com/en-us/library/ms189786.aspx |title=NEWSEQUENTIALID (Transact-SQL) |website=[[Microsoft Developer Network]] |publisher=[[Microsoft]] |date=2015-08-08 |access-date=2017-01-14}}</ref> The [[Oracle Database]] {{mono|SYS_GUID}} function does not return a standard GUID, despite the name. Instead, it returns a 16-byte 128-bit RAW value based on a host identifier and a process or thread identifier, somewhat similar to a GUID.<ref>{{cite web |url=https://docs.oracle.com/cd/B12037_01/server.101/b10759/functions153.htm |publisher=[[Oracle Corporation|Oracle]] |title=Oracle Database SQL Reference}}</ref> [[PostgreSQL]] contains a {{mono|UUID}} datatype<ref>{{cite web |url=https://www.postgresql.org/docs/9.4/static/datatype-uuid.html |work=PostgreSQL 9.4.10 Documentation |title=Section 8.12 UUID Type |date=13 February 2020 |publisher=PostgreSQL Global Development Group}}</ref> and can generate most versions of UUIDs through the use of functions from modules.<ref>{{cite web |url=https://www.postgresql.org/docs/9.6/static/uuid-ossp.html |work=PostgreSQL: Documentation: 9.6 |title=uuid-ossp |date=12 August 2021 |publisher=PostgreSQL Global Development Group}}</ref><ref>{{cite web |url=https://www.postgresql.org/docs/9.6/static/pgcrypto.html |work=PostgreSQL: Documentation: 9.6 |title=pgcrypto |date=12 August 2021 |publisher=PostgreSQL Global Development Group}}</ref> [[MySQL]] provides a {{mono|UUID}} function, which generates standard version-1 UUIDs.<ref>{{cite book |chapter-url=http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html |title=MySQL 5.7 Reference Manual |chapter=Section 13.20 Miscellaneous Functions |publisher=[[Oracle Corporation]]}}</ref> ==== Combined Time-GUID ==== The random nature of standard UUIDs of versions 3, 4, and 5, and the ordering of the fields within standard versions 1 and 2 may create problems with database [[locality of reference|locality]] or performance when UUIDs are used as [[primary key]]s. For example, in 2002 Jimmy Nilsson reported a significant improvement in performance with Microsoft SQL Server when the version-4 UUIDs being used as keys were modified to include a non-random suffix based on system time. This so-called "COMB" (combined time-GUID) approach made the UUIDs significantly more likely to be duplicated, as Nilsson acknowledged, but Nilsson only required uniqueness within the application.<ref>{{cite web |last=Nilsson |first=Jimmy |url=http://www.informit.com/articles/article.aspx?p=25862 |title=The Cost of GUIDs as Primary Keys |website=InformIT |access-date=2012-06-20|date=2002-03-08 }}</ref> By reordering and encoding version 1 and 2 UUIDs so that the timestamp comes first, insertion performance loss can be averted.<ref>{{cite web |url=https://percona.com/blog/2014/12/19/store-uuid-optimized-way/ |publisher=Percona |title=Storing UUID Values in MySQL |access-date=2021-02-10 |archive-url=https://web.archive.org/web/20201129230946/https://www.percona.com/blog/2014/12/19/store-uuid-optimized-way/ |archive-date=2020-11-29| date=2014-12-19}}</ref> COMB-like arrangements of UUID payloads were eventually standardized in RFC 9562{{r|RFC 9562}} as UUIDv6 and UUIDv7.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)