|Perl: the Markov chain saw|
Re^3: efficient perl code to count, rank (B-tree)(update)by LanX (Sage)
|on Jul 17, 2021 at 21:13 UTC||Need Help??|
> How would a database compensate for this?
Databases use structures like B-trees for indexing and sorting and are pretty good in balancing these trees between RAM and disk. °
They optimize the trade-off between memory and time.
Perl is pretty bad in sorting linear stuff which is part in RAM and part on disk.
(Well you could tie an AoA to a file representing a table. Sorting that array would go without much RAM but mean constant overhead with each access. This is certainly worth a shot, but as I said DBs have this already optimized.)
°) from WP B-tree
Unlike other self-balancing binary search trees, the B-tree is well suited for storage systems that read and write relatively large blocks of data, such as disks ...
... for the purpose of efficiently managing index pages for large random access files. The basic assumption was that indexes would be so voluminous that only small chunks of the tree could fit in main memory.