MySQL Forums
Forum List  »  Performance

Pre-DML trigger vs Foreign keys
Posted by: Anushka Dissanayake
Date: June 22, 2012 10:18AM

Hi,
I have a query with regard to the usage of pre-dml triggers instead of foreign keys.
We have several tables with below scenario

As an example I will take 2 tables.


payments ( pid , userid , updated_user )
users (userid , username )

foreign keys
payment .userid -> users.userid
payment. updated_user -> user.userid

In this situation the payment table refers to user table for 2 foreign keys.

My senior DBA suggesting use before-insert trigger instead of 2 foreign keys.

Can any one explain me the performance difference between those 2 and what is the most suitable method.

Please direct me the relevent documents ,if you have any.
Thanking you in advance.

AD

Options: ReplyQuote


Subject
Views
Written By
Posted
Pre-DML trigger vs Foreign keys
2077
June 22, 2012 10:18AM
1044
June 23, 2012 01:56PM
1108
June 23, 2012 05:18PM


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.