LMSouq
database Open

Strings as Primary Keys in MYSQL Database

MA
mainstringargs
1 month ago
3 views
Problem Description
I am not very familiar with databases and the theories behind how they work. Is it any slower from a performance standpoint (inserting/updating/querying) to use Strings for Primary Keys than integers? For Example I have a database that would have about 100 million row like `mobile number, name and email`. **mobile number and email** would be unique. so can I have the mobile number or email as a primary key, well it effect my query performance when I search based on email or mobile number. similarly the primary key well be used as foreign key in 5 to 6 tables or even more. I am using MySQL database

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base