MySQL Forums
Forum List  »  Optimizer & Parser

foreign key creation in a huge database
Posted by: Raffael Vendrametto
Date: March 05, 2015 04:05PM

Hi,


I am working in a huge database, I am trying to insert foreign key in a table with more than 11 millions rows, but is giving me a error;

ERROR 1452: Cannot add or update a child row: a foreign key constraint fails

I deleted all data and created the foreign before import, but during the import I received the same error:

ERROR 1452: Cannot add or update a child row: a foreign key constraint fails

So what I need to do is discovery what rows is not matching on the parent table.

but for do it, I need to run a query to verify this two tables one 11 millions rows and the parent table 3millions rows, without foreign key, this is taking a day, and giving me a error off timeout, which is already too increased.

I would like to know if anyone has any option to solve this problem.
Please this problem should be solved urgent!!!

Thank you!!!

Options: ReplyQuote


Subject
Views
Written By
Posted
foreign key creation in a huge database
2087
March 05, 2015 04:05PM
1017
March 05, 2015 05:42PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.