‫OK, let's talk about this, the final thing, I think the storage costs between Postgres and Mystikal,
‫so people plus three secondary index values and I talk about secondary indexes versus a primary index
‫difference is very important to know.
‫This difference is the two difference between the two.
‫Right.
‫And can either point directly to the two pull.
‫This is an example of Posterous or to the primary key.
‫And this is one of the reasons that Ueber moved from post customizable.
‫So they.
‫Bosco's points deductable as a result, right, amplifications implode and I have a right amplification,
‫Lechter goes to the go to the section where you have a various database discussion, you're going to
‫see the right amplification.
‫Very critical to understand that.
‫Right.
‫So if you if you have a secondary index and the second earners point to the tuple, then the tuple size
‫is really not that large because it's as a fit.
‫I believe it's to be it might be wrong.
‫It might be 60 for a bit, but that is the pointer while the MySQL Sikandar indexes point to the primary
‫keys.
‫So if the primary key is large, if it's an integer, you don't have a problem, really is just tiny.
‫But if it's good or you idy, that is a really bad idea to put a Gwynedd or a UID as the primary key
‫in energy being MISAKO, because any secondary key unfortunately will point to the primary key and plus
‫the whole thing is clustered.
‫So inserts are so slow because of the randomness of the idea is just not worth it at all.
‫OK, so as a result the secondary indexes will be so large because they have all these values that points
‫to two primary keys, which are effectively ideas, which are these large things.
‫And and you can't you can do all sorts of tricks to to to convert you into the stuff using a string,
‫which is I forgot.
‫What's the selling of the ID by so many bytes.
‫Right.
‫One twenty eight I believe.
‫But you can trick it to use sixty four bytes or less than that using the binary representational void.
‫But still you will it is still large.
‫If it's large disk space, the space can fit the memory.
‫Right.
‫Your memory is Prussia's, you might say, okay, I'm going to add one terabyte worth of memory for
‫my private database.
‫Sure.
‫But do you have to really think about this?
‫Right.
‫Scaling and database engineering is not something that you take lightly.
‫You have to think about all this stuff and then all makes sense when you understand these basic fundamentals.
‫That is what I want to convey in this lecture.
‫The B trees are not something you do math on.
‫Every decision you make cost you right.
‫And what is important to understand how these different DBMS make these design choices, because every
‫design choice can lead to a completely different outcome.
‫If a primary key data type is expensive, this can cause bloat and all the secondary indexes.
‫As I talk to my lymph nodes in my school and really B contains the full row since it's an index organized
‫table or a clustered index too.
‫So that's another thing, right?
‫Clustered indexes in general SQL Server.
‫I also have this idea of clustered indexes, clustered index or cluster tables, sometimes called index
‫organize table.
‫So this is it.
‫And this is then index where the index is the table.
‫So if you think about it, this just the whole thing.
‫The leaf node has the whole row and all the columns in it so that everything is is really clustered
‫nicely.
‫It has disadvantages and advantages that I am just not going to go through it.
‫But it's very important to understand that.