Next | Lightweight Databases | 51 |
Instead of making index numbers 10-byte strings, use 4-byte machine integers:
print $index_fh, pack "N", $pos;
Instead of "0 ", we use "\x00\x00\x00\x00"
Instead of "1 ", we use "\x00\x00\x00\x01"
Instead of "10 ", we use "\x00\x00\x00\x0a"
Instead of "1000000000", we use "\x3b\x9a\xca\x00"
Benefit: Smaller index
Next | Copyright © 2003 M. J. Dominus |