Loading video...

Video Failed to Load

Go Home

Query planning is hard. Doing so in a massive, sharded database is even harder. The blog we published today at PlanetScale was a labor of love. So many people from across the company helped with technical accuracy, writing, visuals, and making it the best it can be. This was...

76,234 views • 6 days ago •via X (Twitter)

19 Comments

MetaGunny's profile picture
MetaGunny6 days ago

Great article! I can't stand when people use I'd as the primary key name Like yeah let's use is but on the fks use customerid

Aleksandar Hadžibabić's profile picture
Aleksandar Hadžibabić6 days ago

I think the greatest challenge with understanding how it works is that many people never faced problems that you're solving themselves. Hard to go from theory to practice in this field. Great blogpost and visuals! 🚀

wolfie's profile picture
wolfie6 days ago

gorgeous animations

Charles's profile picture
Charles6 days ago

The animations are so great! Would love to see how you guys build those too

Sagar Dua 🇮🇳's profile picture
Sagar Dua 🇮🇳6 days ago

+1 for blog 👍 Neki supports consistent hash as the sharding method only? Do cross-shard queries scale well -- didnt notice much mentioned about it in the blog.

Preyforge's profile picture
Preyforge6 days ago

the cross-functional part is the real craft here. i make handoffs explicit and keep the complaint verbatim; a polished query plan is only useful when the next person can see what changed and why.

Jye's profile picture
Jye6 days ago

Have you written/talked about how you cooridate content work like this? It's excellent btw

Sumit Kumar's profile picture
Sumit Kumar6 days ago

Went for the cool animations directly and learnt from blog

Morteza Hosseini's profile picture
Morteza Hosseini6 days ago

Looks nice

paske's profile picture
paske6 days ago

damn

Ben Mo's profile picture
Ben Mo6 days ago

Following one customer and their orders makes the shard-key decision click. You can see why a perfectly ordinary JOIN suddenly has a travel budget. More database explanations should start with where the rows actually live.

Deep S Shah🇮🇳's profile picture
Deep S Shah🇮🇳6 days ago

Time to develop Neki, 1 month, the blog post, 2 months

Abhishek Sahu's profile picture
Abhishek Sahu6 days ago

Can u post more on this

Crio Songo's profile picture
Crio Songo6 days ago

查询规划确实越复杂越难搞,尤其是分库场景下坑真多,我晚上去看看这篇博客学习下。

Valentyn Kit 🦀 | Rust · Solana's profile picture
Valentyn Kit 🦀 | Rust · Solana6 days ago

planetscale writeups are consistently worth the read, looking forward to this one.

nana kong ✞'s profile picture
nana kong ✞6 days ago

please keep this comment you have taught me so much in the past three months then I could’ve dreamed of, for years I kind of just put off DBA tasks but I realize now that’s where all the alpha is 🫱🏾‍🫲🏻

shaurya pratap singh sisodia's profile picture
shaurya pratap singh sisodia6 days ago

This is really amazing work

Shrey Gupta's profile picture
Shrey Gupta6 days ago

great talk!

Adam · silent data failures's profile picture
Adam · silent data failures6 days ago

The sharded case is where a planner stops being an optimisation and becomes a correctness surface, because a plan that fans out to the wrong shard still returns rows. What we watch is whether the row count matches across a re-plan. Does the post cover plan stability?

Related Videos

A DEVELOPER FOUND SEVEN WAYS TO TAKE DOWN A PRODUCTION DATABASE THAT ALL LOOK EXACTLY LIKE NORMAL, INNOCENT CODE AND ALMOST EVERY TEAM IS SHIPPING AT LEAST ONE OF THEM RIGHT NOW 17 minutes from Josh Berkus, one of the people who actually maintains PostgreSQL, walking through the quiet mistakes that turn a healthy database into a 3am outage. -> The moment it lands, you realize none of these are exotic attacks. They're ordinary-looking decisions -- a query that locks a table, a connection that never closes, a setting no one ever questioned -- that work perfectly until the day they don't, and then they take everything down with them. The scary part isn't that the database breaks. It's how normal the code looks right up until it does. A query that runs in 5ms on your laptop and 5 minutes on prod. A migration that silently locks the whole table. A connection pool that runs dry the moment real traffic shows up. Every one of them passed review. Writing SQL that runs was never the hard part -> writing SQL that survives production is. And now that an AI agent is generating and firing queries at your real database faster than anyone can read them, every one of those seven landmines is one autocomplete away -- and the only person who can stop it is the one who already knows where they're buried. Your database doesn't go down because someone attacked it. It goes down because something that looked completely normal finally caught up with it. Save and Watch it today. You'll see the next outage coming before it lands ↓

slash1s

22,268 views • 3 months ago