News for hackers. Stuff that matters.
Re:Things that don’t work well with MySQL’s FOREIGN KEY impl... by noduerme on Tuesday May 02, 2023 @01:37AM (#35783754)
Sorry if this is an absurdly simple question... What is the point of a foreign key that has no cascade? Just to help speed up indexing?
Re:Things that don’t work well with MySQL’s FOREIGN KEY impl... by gregw2 on Tuesday May 02, 2023 @07:50AM (#35786125)
Not sure the specific MySQL thinking, but FKs in a large data model help new people understand or confirm relationships, and also make importing your data model into an ERD tool for documenting to others much easier. FKs which enforce relational integrity are always useful against bugs. Some query planners (e.g Redshift) even use FK relationships to optimize query plans even when there aren’t indexes nor constraints provided by FKs.