The challenges of supporting foreign key constraints
planetscale.com
The challenges of supporting foreign key constraints
1–10 of 51 posts
Re: The challenges of supporting foreign key constraints
#2Re: The challenges of supporting foreign key constraints
#3Post author here, happy to answer technical questions.
Re: The challenges of supporting foreign key constraints
#4Post author here, happy to answer technical questions.
Re: The challenges of supporting foreign key constraints
#5Post author here, happy to answer technical questions.
So how do you deal with orphaned child rows when reverting? I assume it's up to your users to deal with them or not? This very much seems like a clever automation for chosing when to care about foreign key constraints and not outright enforcement
It's worth noting that MySQL has no problem with this kind of situation. It never cares about the existence of orphaned rows. It only cares about not letting you creating them in the first place, and it cares about cleaning up. But it doesn't blow up if orphaned rows do exist. They will just become ghosts.
Re: The challenges of supporting foreign key constraints
#6Re: The challenges of supporting foreign key constraints
#7The Planetscale blog consistently puts out such high quality posts. I can highly recommend following their YouTube channel as well. I’ve learned a ton from the incredibly well made videos Aaron puts out!
Re: The challenges of supporting foreign key constraints
#8Re: The challenges of supporting foreign key constraints
#9Earlier quoted context omitted.
I am the other post-author, and I am available too.
This was a great read, thanks. Are there any plans to support recursive CTEs? What are the technical challenges there?
We recently started adding support for CTEs in Vitess! You can check out https://github.com/vitessio/vitess/pull/14321 if you want to see some technical details of the implementation.
For now, we have added preliminary support by converting them to derived tables internally, but we believe that we need to make CTEs first-class citizens themselves of query planning, specifically because recursive CTEs are very hard to model as derived tables. Once we make that change, we can look towards supporting recursive CTEs.
This however will take some time, but then, all good things do!
Re: The challenges of supporting foreign key constraints
#10This feature truly is a game-changer for adoption IMO.
Congrats on shipping to all involved!