samedi 20 décembre 2014

using foreign key as primary key


MySQL:


If I have a user table and multiple other tables like seller, buyer etc, is it okay to use user_id foreign key as primary key inside tables like seller, buyer?


That'll leave gaps in primary key field of such tables. Would that result in slower queries? Also, will mysql attempt to use up the gaps by inserting new items in middle (which I don't want)?





Aucun commentaire:

Enregistrer un commentaire