Prior Conditions are
- Table will have data in billions
- Table will have secondary indexes
- Table's primary key will be a foreign key of another table.
- Table will have a heavy data (another column may be Text).
Primary Key must be Unique, cause my database is replicated over machine's that's why I am choosing UUID.
PS: space is also a concern so I guess Varchar(36) might be the bad idea
I agree with BINARY(16)
. (16 bytes is better than 37.)
But UUIDs are hopelessly inefficient for huge tables. (I assume your billion-row table will not fit in RAM.)
I discuss those and more issues in http://mysql.rjweb.org/doc.php/uuid