We have a huge InnoDB table with hundreds of millions of rows and only 3 columns: GUID, enum, smallint. All searches are performed using the GUID.
We plan to make a PK GUID and split it into KEY.
We have heard that using a GUID as a PK is bad due to its random distribution and the fact that PK creates a clustered index. Thus, storing strings in random GUIDs increases fragmentation and page splitting.
An alternative to using a GUID as PK is to create a surrogate auto-increment key and use it as a PC. However, if we want to partition the table by GUID, this GUID must be part of PK. In addition, since all requests are executed using the GUID, we need an additional GUID. This index essentially displays GUID-> PK, and if we use the GUID as PK, does the table itself display GUID-> enum + small int?
So my question is, are we getting anything by adding auto-inc PK and having an extra GUID?
Thanks, Filopator.
source share