‫So what is the pros and cons of partitioning, is this thing perfect?
‫Obviously, nothing is perfect.
‫There's always everything is a double edged sword when it comes to back in engineering.
‫And we need to understand this thing as back in engineers.
‫Right.
‫So the pros of partitioning is beautiful because it improves the query performance.
‫Yeah, we didn't really notice as much of my demo because I'm using a laptop and I want to docker container
‫but improve and increase that the size of the tables to the billions and make so that your memory,
‫your memory bound or ironbound, because I wasn't even remotely born or eyob on my table in my case.
‫Right.
‫Because I had I had this loss of memory to work with.
‫But if you are limited with the memory, you can start seeing it because you're going to pay to disk
‫and you're going to hit Io's and you start feeling the query versus working with a huge table.
‫Right.
‫So a performance when working with a single partition or a little bit fewer partitions.
‫It's a little bit way better, actually, than working with a huge single table.
‫And so working with a smaller partition is always better.
‫So as long as I know how to hit that partition, that's the key here.
‫So sometimes the database decide on a sequential scan versus a scattered index scan.
‫So, guys, the database always makes decisions.
‫This is called the planner.
‫The Planner.
‫The David says, OK, you are Sinemet query and there is an index on the table.
‫But I don't have to use the index.
‫If if you're going to pull every single rose in the table, it's a waste to head the index, actually,
‫because going to the index, you're going to start jumping through an index and going back to the table
‫and going back to the index and then go back to the table.
‫That's actually slower sometimes to head the index.
‫Right.
‫And it's called scatter index scan.
‫That's slower.
‫So those are the database.
‫Decide to hit a sequential scan on the table directly says, you know what, it's not worth it to you
‫as the index for that particular query, because I'm going to select lots of rows.
‫And that's a complicated logic, fuzzy logic by the database.
‫And that includes a lot of EHI, if you think about as well, to to actually decide what to do.
‫So some based on that, a partition by giving the partition is actually smaller right now.
‫It actually can make this decision easier because, hey, psychological screening is actually better
‫in this case, then a scatter index card on a huge table.
‫So deciding which one is you just made the life of database easier using partitions.
‫Beautiful, beautiful, easy bulk loading.
‫So if you have, you can essentially just create a table and attach it to the partition immediately,
‫right to the partition table without without worrying about anything.
‫So you can bulk data load in into a given table and then attach that table to an existing partition
‫table, given that actually the constraint and the checks are all valid and all that stuff.
‫Right.
‫You can just attach of invalid partition.
‫Right.
‫So this is this is a very popular thing.
‫It's really in my school you can actually have a CSV file and create the storage engine because that's
‫only available.
‫And MySQL and morality by belief have the CEV be the storage engine for a given table.
‫And just like that, you have a table magically.
‫If you have like a a three hundred million servers, you point your table to that CEV and you have a
‫table that you can query immediately.
‫Right.
‫And then you can use that to attach it.
‫It's a little bit complicated, but that's one benefit of using MySQL over Polska, for example.
‫Obviously, that doesn't mean MySQL is better than Paul's because that's just one use case archive.
‫All data that are barely accessed into storage.
‫Right.
‫Two thousand one data that partition is no longer used.
‫You have barely queried.
‫And you can check this thing real quick.
‫That's actually pretty neat, right?
‫This partition table is barely query.
‫So let's throw it in a table space so that that nobody is using on a drive that is pointing to an old
‫hard disk that is slow and cheap.
‫Right.
‫And let's use this precious our precious SSD and beautiful, beautiful hour fast, frequently access
‫data.