Home > database >  Discussion: snowflakes can ID as the primary key
Discussion: snowflakes can ID as the primary key

Time:12-10

Snowflakes ID only generated values, since it is orderly, can not as the primary key of the database, clustered index performance will be how?

CodePudding user response:

https://www.cnblogs.com/sunyuliang/p/12161416.html

The simplest is the most efficient,
id int identity (1, 1) primary key
Is this int integer since the increase is the most efficient,
If the data quantity is big, can convert bigint long integer,

The guid is one of the least efficient, distributed, the only advantage is that can do

Call snowflakes id, which is generated from the definition of ordered long integer, efficiency is good, after all, orderly,
But must be below the int the increase of efficiency,

However, the id for the programmer of the code language requirements is relatively high, to test a lot, to avoid more WEB server generate repeat. The id of the
  • Related