RT, I just want to display the database structure more clearly in the database relationship diagram. As for the foreign key constraints, I will implement them in the code. Will setting both delete and update operations in the database to NO ACTION affect performance?
RT, I just want to display the database structure more clearly in the database relationship diagram. As for the foreign key constraints, I will implement them in the code. Will setting both delete and update operations in the database to NO ACTION affect performance?
The poster seems not to understand the respective functions of several foreign key constraints. Performance and not using foreign keys will certainly have an impact
<code>CASCADE #在父表上update/delete记录时,同步update/delete掉子表的匹配记录 SET NULL #在父表上update/delete记录时,将子表上匹配记录的列设为null 要注意子表的外键列不能为not null NO ACTION #如果子表中有匹配的记录,则不允许对父表对应候选键进行update/delete操作 RESTRICT #同no action, 都是立即检查外键约束</code>