Definitely an underrated one! This was a great learning. Thanks so much, Arpit for explaining + implementing it in a very thorough yet highly understandable way. Great watch!
(Thinking out loud)If we know that an int is max of some bytes like 8 bytes in this video case. Don’t check for the continuation bit in the last byte by that in case where all bits are 1s we can suffice in 9 bytes as opposed to one extra byte for the overflowing 1bit in the last?? Am I missing something here?
Hi Arpit, The explanation was quite thorough, got to understand a new thing that dbs transmit varint data using byte array. BTW, which VS Code theme extension you use?
So does it mean, varint is not space efficient if an integer completely occupies the required space? i.e. for a 64/32 bit integer if all bits are used then varint will require 10 bytes/5 bytes, were as if varint encoding was not used space required will be 8/4 bytes
Definitely an underrated one! This was a great learning. Thanks so much, Arpit for explaining + implementing it in a very thorough yet highly understandable way. Great watch!
Thanks Tiya!
This was a great learning. One question I have is that, who actually does this Encoding/Decoding? Is it performed by Query optimizer?
(Thinking out loud)If we know that an int is max of some bytes like 8 bytes in this video case. Don’t check for the continuation bit in the last byte by that in case where all bits are 1s we can suffice in 9 bytes as opposed to one extra byte for the overflowing 1bit in the last?? Am I missing something here?
Hi Arpit,
The explanation was quite thorough, got to understand a new thing that dbs transmit varint data using byte array.
BTW, which VS Code theme extension you use?
Thanks for the video Arpit, now I am having a strong urge to implement it :P
Go for it. It is worth the time. Plus I have linked the repo for reference.
Could you please explain why did you take an array of 11?
Because that's the max number of bytes we can have for an 8 byte long integer when encoded as varint.
64 bits number = ( 7 bits of number + 1 continuation bits) x 9 + ( (1+6) bits of number + 1 continuation bits ) = 80 bits or 10 bytes
Is it correct?
@@KunalKumar-kc1bwthanks for the explanation Kunal
So does it mean, varint is not space efficient if an integer completely occupies the required space?
i.e. for a 64/32 bit integer if all bits are used then varint will require 10 bytes/5 bytes, were as if varint encoding was not used space required will be 8/4 bytes
@@uzairshaikh6733 for large values it is not. But how often do you use large integers?
Which app do you use write all the text?
GoodNotes
Database folks taking internal fragmentation quite seriously