I have a table with around 30 million rows in MySQL 5.5 using the InnoDB storage engine. This table has a foreign key that links to another table with around 3 million rows.
I want to add a primary key to the larger table, but am unsure of how best to go about this. There's no existing column (or set of columns) I can use for this, so how should I go about this?
I have seen some references to an internal InnoDB record ID, but have not found if this is accessible.
Otherwise, perhaps I will need to dump and reload the data, adding the id in manually.