| ▲ | j0shk0 2 hours ago | |||||||||||||||||||||||||
Thank you! | ||||||||||||||||||||||||||
| ▲ | OskarS 2 hours ago | parent [-] | |||||||||||||||||||||||||
One thing to add is that databases tend to take it further using compression. For instance, if you have a column that is all either A or B, you can use run-length encoding ("the next thousand entries are B"). Or you can do delta encoding: if you have some very large number that takes a lot of bits to store, but the deltas between them are quite small, you can save a lot of disk space and I/O by just storing the deltas. You can also combine these two: if you have a numeric id that increases by 1 every row, you can delta-encode that to just get a massive list of 1's, which you can then run-length encode to just be "the delta for the next million rows is 1", saving huge amounts of space. You generally don't do this with AOS/SOA, because you do want to be able to random-access your entries ("index" them, in database terms) and I/O performance is much less important. Databases have this issue too, which is why indexes tend to either not be available or much slower in column-oriented DBs. EDIT: ah, read the original commenter a bit too quickly, missed that they mentioned run-length encoding. Apologies. | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||