I have a table with 5 columns one of them is a uuid generate by an application. In the table the uuid colum is varchar(64) and the primary key is a int autoincremental. Is it bad idea delete the id column and use uuid like primarykey?
Asked
Active
Viewed 92 times
0
-
1Do you need the `id` column? Are you inserting many rows? Do you have many secondary indexes and foreign keys? As you should guess now - The answer is: "It depends". – Paul Spiegel Sep 20 '19 at 16:01
-
Are there any child tables referencing rows in that table? – Thorsten Kettner Sep 20 '19 at 16:07
-
1Smal tables it doesn't matter at all, but with big tables millions of rows there are some speed issues – nbk Sep 20 '19 at 16:09
-
More on speed issues with UUIDs: http://mysql.rjweb.org/doc.php/uuid – Rick James Oct 05 '19 at 23:24
1 Answers
0
Probably yes! Numerical keys takes up less memory and index works with better performance at first.
I found a similar discution here

Andre Carneiro
- 708
- 1
- 5
- 27