- 30
- 339 990
Tony Saro
Spain
เข้าร่วมเมื่อ 4 พ.ค. 2024
I make computer science & low level systems programming videos 👨💻.
#computerscience #programming
#computerscience #programming
The Most Complicated Algorithm I've Ever Written: SQLite B-Tree Balancing
In this video we visualize how the SQLite 2.X.X B-Tree balancing algorithm works. Technically it's not exactly the algorithm from SQLite but my own version which I implemented for MKDB. My version is almost a 1:1 Rust copy of the original algorithm implemented in C which you can find linked below.
🌐 LINKS
Algorithm Implementation:
github.com/antoniosarosi/mkdb/blob/bf1341bc4da70971fc6c340f3a5e9c6bbc55da37/src/storage/btree.rs#L1627
Original SQLite Implementation:
github.com/antoniosarosi/sqlite2-btree-visualizer/blob/e6d1786a878e0497289d208f7302802b6bd4a9a1/src/btree.c#L2171
✉️ CONTACT INFO
Business Email: business@antoniosarosi.io
Contact Email: sarosiantonio@gmail.com
Twitter: antoniosarosi
Instagram: antoniosarosi
LinkedIn: www.linkedin.com/in/antoniosarosi/
🎵 MUSIC
th-cam.com/video/oCEcHE_jWfI/w-d-xo.html
th-cam.com/video/a7NaCCQEdE0/w-d-xo.html
th-cam.com/video/AgzKnzmZ1z8/w-d-xo.html
📖 CHAPTERS
00:00 Introduction
00:41 Databases & B-Trees
03:30 The Balancing Algorithm
09:24 Deleting & Balancing
12:03 Final Thoughts
🏷️ HASHTAGS
#programming
#computerscience
#algorithm
🌐 LINKS
Algorithm Implementation:
github.com/antoniosarosi/mkdb/blob/bf1341bc4da70971fc6c340f3a5e9c6bbc55da37/src/storage/btree.rs#L1627
Original SQLite Implementation:
github.com/antoniosarosi/sqlite2-btree-visualizer/blob/e6d1786a878e0497289d208f7302802b6bd4a9a1/src/btree.c#L2171
✉️ CONTACT INFO
Business Email: business@antoniosarosi.io
Contact Email: sarosiantonio@gmail.com
Twitter: antoniosarosi
Instagram: antoniosarosi
LinkedIn: www.linkedin.com/in/antoniosarosi/
🎵 MUSIC
th-cam.com/video/oCEcHE_jWfI/w-d-xo.html
th-cam.com/video/a7NaCCQEdE0/w-d-xo.html
th-cam.com/video/AgzKnzmZ1z8/w-d-xo.html
📖 CHAPTERS
00:00 Introduction
00:41 Databases & B-Trees
03:30 The Balancing Algorithm
09:24 Deleting & Balancing
12:03 Final Thoughts
🏷️ HASHTAGS
#programming
#computerscience
#algorithm
มุมมอง: 43 085
วีดีโอ
The ORDER BY Algorithm Is Harder Than You Think
มุมมอง 61K2 หลายเดือนก่อน
In this video I describe in detail how my implementation of the K-Way External Merge Sort algorithm works. K-Way External Merge Sort is an algorithm used to sort large datasets that don't fit in main memory (usually RAM). Therefore, this algorithm is used by databases like Postgres to process ORDER BY queries when tables don't fit in memory. The algorithm consists of a series of "passes" throug...
Not only is this actual, real software engineering, as other comments have made it clear, but your teaching method is incredible! You've managed to make me follow you on an incredibly high level technical conversation even though my current technical understanding is that of a measly junior web dev. I want you to know that every single second you spent creating all these visualizations, explanations and teaching patterns was well used and highly, highly appreciated. I expect many of those seconds were painful, as I have some video editing experience myself, but for every one of your sweat drops, the quality of this video sky rocketed! Thank you!
Impecable investigación y video. Te felicito. El otro canal ya fue? Saludos.
Sí, ya fue jajaja
😮😮😮 beautiful project ❤️❤️ great job
Thanks for the video this makes it so easy to figure out what to learn at least to know How things work. The format is so good I don't feel like I was spoon fed anything which I love.
And could you kindly post where to find the code that auto adjusts the data into HRF? In oracle we have to set the columns, page size and line size differently each time
You mean the tables? I'm just using the Alacritty terminal, changing the zoom levels adjusts the lines.
What flavor of Linux did you personally use? Version too if you’d be so kind.
ArcoLinux with Qtile window manager.
this content is priceless
everything is great in this video. Love the idea, love the explanation. Love the looks and the accent
Tengo un par de preguntas ¿Ya no vas a subir videos en tu canal en español? y ahora ¿Este va ser tu nuevo canal principal?
No voy a subir más vídeos en el otro y este será mi canal principal.
Excellent. i love this guy.
O man, you are awesome. Please keep making cool stuffs like this
When people tell me I'm smart I tell them that's not true because I know people like you exist. Bravo on this achievement.
I wouldn't say I'm smart, I'm just persistent enough.
Looks like legacy code to me 😂
This is it. This is software development. Thank you, Thank you so much for this. Amazing approach. Awesome 🤩 🤩 🤩
Neovim, Rust, tiling WM, based
Wait is that comic sans
😂😂😂 it's one of the nerdfonts.com, I switch them from time to time.
7 month timelapse engineering with that much of analysis, explanation, video quality and stuff.. man that was incredible! Much respect! Really nice work! Subscribed! Project idea: recreating a video processing software for demonstrating how to create 1min of accelerated footage of 7-month of daily programming vlogs lol, even this had to be took forever! xD
I'll have to get into video processing at some point haha, looks interesting, for now I'm focusing on stuff that I am more familiar with since I work as a fullstack dev, so databases are not alien to me. Video processing, audio processing, image processing, graphics... I literally know nothing about that.
A few weeks I was curious to know how databases work. A few days I found your English channel with this valuable content
Such an amazing content!!!
Acá alguien al que le duele que este tipo de contenido no esté en español, (incluso con muchas esperanzas de que vuelva 4tomik xD) Pero ey, hay que comer, y está perfecto que quieras hacerlo en el lenguaje que quieras, te deseo el mejor de los éxitos :) lástima que no mucha gente se interese más en cómo funcionan las cosas por debajo, espero nuevos videos! Saludos desde argentina :D
En español no hay suficiente audiencia. A este vídeo le hubiera pasado como al video del memory allocator o el reverse proxy hubiera llegado a 20K views en el primer mes en lugar de 200K como aquí.
Why do you code in rust instead of c or c + +? I mean that c or c++ is more suitable for this kind of projects. SQLite, postgreSQL, Oracle, Ms sql and mysql. All of them are written in c/c++ , what are your decisions to choose rust instead of c/c++?
They're not written in C because "it's more suitable". They're written in C because they started development in the 1990s. Nowadays there are some options other than C or C++. Rust is a more modern language, it has generics, pattern matching, closures, traits, package manager, built-in data structures and other utilities in the standard library, etc. C doesn't have any of that, either you write it yourself or use third party code.
I used to follow you in your previous channel, and honestly I was pretty upset that you stopped uploading videos. Such a pleasant surprise to find you here! New sub here and all the best, man :)
Underrated bro!
Quick question, Can you explain where the transaction actually work? where is the state to be updated stored before calling commit
The transaction state is stored in memory. Then there's a journal file that keeps copies of the original pages so that they can be reversed if you ROLLBACK or if the system crashes. Here's where most of the "transaction" stuff happens: github.com/antoniosarosi/mkdb/blob/bf1341bc4da70971fc6c340f3a5e9c6bbc55da37/src/db.rs#L1079
antonio hazlo en español, plisss
Estos videos no funcionan en español, metete en mi Instagram y mira las historias destacadas.
wow! encontré el canal de antonio sarosi, podriás añadir con la nueva función de youtube, pistas de audio, para que también llegue a mas audiencia.
No la tengo disponible.
lmfao first mistake, making your own database haha
Really cool! Love your content man
7:16 R , L, R, LL, LR, RL, RR, LLL, LLR, LRL, LRR, RLL, RLR, RRL, RRR is how you store the binary tree on disk.
The problem isn't storing the order of the nodes, the problem is coming up with a binary format that can be easily modified in memory. Watch the video until the disk B-Tree part and you'll understand.
SQLite is a perfect example how not to write a database.
According to who?
👏👏👏👏👌👌👌
Github code for it ??
In the description of the full video.
While watching the video, I suddenly felt the urge to subscribe to the channel. I was surprised to see it only had 21k subscribers; I expected it to have at least 500k. Lol
Haha I just started it a couple months ago, getting so many subs takes years.
bro can u explain this
It's a clip from my Database video. You can find it on my channel.
@@tony_saro I just checked, 😅.u have done grate work specially the explanation u have written for split.
thanks sir.
Te sigo desde el canal en español, siempre tuve la duda de las bases de datos sobre todo el query planner, saludos exitos en este canal, una disculpa si escribo en español, mi ingles no es muy bueno.
everyone is a gangster until the real gangster arrived. I push the button "Subscrided" immediately just as the "The Voice" judges do. Your hardcore-ness as a software engineer is inspiring. Thank you for this video.
Ahhhhh, ahora te la tiras de gringo. Jajaja buenísima, gracias por el vídeo
Jajajaja 🇺🇸🦅
Very cool and invormative video! Keep going
i want to become u 🤓
I don't recommend it
Probably at 0:15 I have paused the video, opened your channel in new tab. Subscribed, and back here. No one is there to touch these topics. I salute you for sharing your knowledge.
Super big brained. Thanks Tony this is a gem
I have two questions: 1. In case of underflow root, ehy the page numbers are not modified when the depth gets decreased by 1? In that case the child pages have a wrong page number 2. Are the indexes loaded into a btree upon initialization? Thanks
Only the page pointers are modified when reorganizing entries.
Indexes are not "loaded" upon initialization, they are created with the "CREATE INDEX" statement and then they exist on disk.
no word describes what are you done ❤❤
Fantastic video, I agree with others, so nice to see some real software engineering
Please do a long premium course on Algorithms (preferably implemented in Rust, Go or C) on Udemy or similar platform. I bet it will sell like hotcakes. I somehow managed to avoid that topic over the last 10 years but now going to learn them in depths (within next months).
Yeah it's a good idea, I will at some point, but I can't right now.
Rust, Databases, Algorithms, Neovim & Linux - What do you need more in a video? :D
Dude that's dope! Could you share with us how you build such good animations? Just After Effects / Davinci Fusion? Or any additional tools? How much time do you spend per minute of final video? I guess at least 1-2 hours per minute?
Yeah it's about 1-2 hours per minute. I don't even use After Effects it's just Adobe Premiere with the "Essential Graphics".
@@tony_saro Hey man, thanx for responding that quick! I have same Wallpaper as you @ 12:09 on the right Display! :D Did you learn this kind of video production with basic Premiere Pro tutorials or are there special kind courses? Can you suggest any to learn from? Or any payed / premium ressources? I want to create vids like yours / let's get rusty's /Dreams of Code's etc on Linux, FOSS, Vue, Golang and Rust as well, but can't find the right resource to get started. Anyhow, subscribed!
I didn't use any courses at all, you can start with a basic Premiere tutorial on TH-cam and after that search for specific tutorials, "how to do X in Premiere". That's all I did, but keep in mind these are not my first videos, I have another TH-cam channel in Spanish which I started in 2019, so I have a lot of experience with editing.
@@tony_saro thanx man! yeah, probably just need to get started and then it comes from alone. Going to do a Davinci Resolve course next days on Udemy (canceled my Adobe CC long before I switched to Linux from Mac - even more evil to me than Apple, Google & Co, on the same level as Oracle). Looking forward to more vids on your projects here on TH-cam!
Que paso con el español?
instagram.com/s/aGlnaGxpZ2h0OjE3ODUxMDI2NDY1MjQ5NzA1?story_media_id=3399154947095379898_1492796422&igsh=bzl3MTJ4ZTNvNHd4
What a productive way to learn complex topics and also sharing it. You are a real software engineer!
Kibybytes