contrail icon indicating copy to clipboard operation
contrail copied to clipboard

Change primary key (uuid) from varchar(255) to binary(16)

Open jnpr-tjiang opened this issue 7 years ago • 0 comments

One optimization could be done is to store uuid as binary(16) instead of varchar(255). Because primary key is going to be in every secondary index table and foreign key constraints and index tables need to be cached in mysql memory to get better query performance, it is a big saving if we can reduce the uuid (primary key) from 255 to 16 bytes. Here is a nice posting on uuid as primary key:

https://mysqlserverteam.com/storing-uuid-values-in-mysql-tables/

jnpr-tjiang avatar Dec 29 '17 04:12 jnpr-tjiang