![Tony Saro](/img/default-banner.jpg)
- Видео 29
- Просмотров 190 788
Tony Saro
Испания
Добавлен 4 май 2024
I make computer science & low level systems programming videos 👨💻.
#computerscience #programming
#computerscience #programming
The ORDER BY Algorithm Is Harder Than You Think
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" through one or multiple files and a number of in-memory buffers used to load and process different chunks of a file in each pass. The end result is a file that contains all the requested rows sorted by the keys given in the ORDER BY clause.
🌐 LINKS
Algorithm Implementation:
github.com/antoniosarosi/mkdb/blob...
🌐 LINKS
Algorithm Implementation:
github.com/antoniosarosi/mkdb/blob...
Просмотров: 27 324
Видео
Writing My Own Database From Scratch
Просмотров 148 тыс.Месяц назад
Writing My Own Database From Scratch
Virtual memory?
Why did you stop doing videos in spanish?
Just wanted to thank you for this. In near future, if you have time will you implement redis from scratch with master replica command propagation.
I don't know, I won't touch databases any time soon after this project.
@@tony_saro Well it Iooks like I need to wait
what about lsms tho?
i want to create content like this what you advise me ?
Don't know man, if you wanna spend 7 months programming just to make a video that's on you 😂😂😂
I feel like this could take a while 😂
The animations are cool, and your explanation is right and on point. Really enjoyed your content 👏
What do you use to draw the diagrams and their animations? Look very good!
Adobe Premiere
I remember my dad describing this algorithm to me - except he was doing it on an old mainframe where each of the temporary files were on tapes that needed manually changed between passes!
No it isn't
What isn't?
Where does the query result set get stored in this case to allow you to interate through one by one?
The result set is stored in a memory buffer and if it ends up being larger than the buffer then it's stored in a file. You iterate one by one over the database rows, not the result set.
@@tony_saro Hey thanks man. Keep up the good work 💪
eso es contenido del bueno, eres el mejor crack, si se te ocurre hacer estos mismos videos en español , asi sean de paga, por aqui tiene un cliente! 😎
Estos videos son gratis, los hago en inglés porque tienen más público que en español.
That's true
Why do databases tend to do their own swapping to temporary files for tables that don't fit in RAM rather than just doing everything in-memory (with a cache-friendly algorithm) and letting the OS's paging facilities handle swapping to disk. Process memory can already be much larger than RAM (with appropriate swap space configured).
Because the replacement algorithm is determined by the OS in that case. Databases don't have control over that, and the OS doesn't know anything about databases so they just roll their own optimized algorithms.
Ya era muy fan de tu otro canal y youtube me recomendo el nuevo. Brutal el contenido, ya me imagino que lo haces en ingles xq en español este contenido serio no gusta. Keep going in that direction eager to see new content :)
Exacto, no es que no guste sino que hay muy poca gente interesada en este contenido. Lo estuve explicando en Twitter e Instagram.
That's a lot of insights and your work will definetely pay off ! Good video !
Wow, thanks for this! Amazing content. I wouldn't be able to do anything you did here, but it was already instructive to just follow along. Keep up the good work :)!
Wow, That's a great effort keep doing it. I can't understand how those slotted pages work. If you can build a simple database that can have only one table without a parser & explain it would be great for new engineers.
Slotted pages themselves are not hard to understand, the problem is they are part of a B-Tree which is hard to understand.
@@tony_saro Yes, but i could undertand things on high level. Still how it looks on code level will be super helpful. I tried to explore the code base of sqlite. I have good basic understanding of c & data structures. Could you help me to understand the sqlite code base or suggest me some resources.
Explore my code instead, it's linked in the description and it has many diagrams and comments explaining what's going on.
Well, those not laughing to this video wouldn't laugh at my story :) Something like 30 years ago (namely somewhere between 1990-1996), I wrote my own database in Prolog (Turbo Prolog from Borland). If you think about the history of databases, it made more sense to do at that time. Then I happen to see other databases which were much better than mine :) (no internet, no exposure to other programmers around the world at that time - and no Rust, that I am trying to learn, just for the sake of writing extensions to postgreSQL)
Uno de los mejores videos que vi, sigue haciendo videos!
Please, continue with those projects. I would donate money if the currency in my country wasn't worthless outside here 😅😅 I learned about it at the USP (University of São Paulo), but this video is aggregating me a lot of new knowledge. Thanks for the content!!!!
Man, you're a breath of fresh air among those "todo app in JS", "best text editor of X year", "why i switch to this prog language" bullshit.
Acabo de ver tu video donde hiciste un reverse proxy propio y me pregunté ¿que no es el mismo tipo que hablaba inglés del video donde hace su propia base de datos el cual vi ayer? Y para mayor sorpresa, me entero que el primer video de tu canal en español es el que lo vi hace 5 años cuando apenas lo habías subido de manera espontanea y cuando yo también recién estaba en estudios. Realmente increíble tu crecimiento en conocimientos en estos años y hasta en idiomas. Estos proyectos son, de verdad, otro nivel.
Open English?
?
What happened with your spanish channel?
Lo expliqué en Twitter e Instagram, metete en Twitter y mira mis respuestas
This is a great video, a hidden gem, considering that most of the content on RUclips is basically how to write a hello world. Where did you upload videos about the memory allocator and reverse proxy?
I have another Spanish speaking channel where I've been uploading videos since 2019. I didn't link anywhere because I haven't added subtitles to those videos yet.
You should definitely do that, your videos are GREAT. Can you share the link to your Spanish channel?
@@marinrusu9179 ruclips.net/video/HLMPUrm376E/видео.htmlsi=RLMYccEpkSzY3jUJ
Awesome
Please keep up the good job
Thank you. Greetings from Colombia! I am learning English and programming with these videos.😊
Thank You again! A really interesting problem with different sizes.
Thank You, I never learned more on 1 video! Really crazy, putting all this details together. It is easy use a LMM (Keras, Tensorflow,...) in Python, but take 1 look into the hidden source-code, it is all C, C++ and Fortan😀
This video is insanely underrated... would love to see more real world projects like these!
Hey pal! Thank you very much! I wanna to create my own dbms(cloud, embedded and so on) too! If I would have a some result than can I send a repo github under you commentary?)
I think RUclips will flag it as spam if you add a link to your commentary
Thank you
Subscribed
Nos olvidaste, toñito:c
Ya he hablado sobre el tema en Instagram y Twitter.
Perfectamente explicado, y eso que no se me da muy bien el inglés
No se que me dio mas placer si escucharte hablar ingles o la explicacion JAJJAJ. La verdad no sabia que tenias este canal, espero reciba mucho apoyo Lo que si en donde explicaste del algoritmo de reemplazo de paginas, si no me equivoco usaste el algoritmo WSClock que es una mezcla entre el algoritmo de reloj y el de conjunto de trabajo, pero creo que es ese. Saludos.
El algoritmo lo he sacado de aquí: ruclips.net/video/BS5h8QZHCPk/видео.htmlsi=0cEHpB37sYfuoI67
Muy buenos tus videos. Las animaciones hacen que sea mucho más fácil de entender. Saludos!
Dude I’m so glad I found you, this super cool content. I appreciate your video and the effort put into. I didn’t think I was interested in system programming until I watched this lol.
Amazing explanation about the sorting, but I'm actually not sure you need to sort the whole table any time someone asks for top N values... It would make much more sense to select the top 100,and then just sort that 100
Check the pinned comment
I wanted to rewatch this video just because, so I searched for it on the search bar. I scrolled down for a VERY long time. Never found it. I only managed to find this video again after going through my history on RUclips and using Ctrl+F
Well that's weird, if you search for "writing my own database" it should show up.
@@tony_saro I didn't remember the name of the video, so I searched something like "sql database from scratch" and that didn't give me it.
For some reasons I see that the only goal they have in their mind is "pub".
It's not a public API it's only used internally, so why bother making fields private if you're gonna have to add getters/setters anyway 😂
@@tony_saro I mean literally "pub".
Oh I see, I understand what you mean now 🍻😂
This video is pretty good at picturing file operations as something that just works and not a clusterfuck at all.
It just works but it's not easy to implement at all 😂
This is actually valuable lessons presented in awesome way. Man i just hope you blow up because we need way more of this this type of content.
Working on it 📈
Most underrated video ❤
The world is full of smart people with not enough to do.
I just do these kinds of things out of pure curiosity, not because I don't have anything to do 😂. This doesn't even pay the bills haha
Adding 5 years of `mkdb` experience into my resume after watching this video.
No way man Amazon and Google are looking for you 😂😂😂
You are the real gangsta for having done all this. Extremely helpful, nice job man👏!
In reality, creating a compiler isn't that hard of a work (I mean just to learn, not a production compiler). In my university, one of the classes is completely dedicated to learn how a compiler or a interpreter really works and the final project is building your own compiler for a professor designed language. Great video, I missed your Spanish videos!