]> git.ipfire.org Git - location/location-database.git/commit
Migrate to a binary-encoded database format
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 14 Jan 2019 07:58:49 +0000 (07:58 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 14 Jan 2019 07:58:49 +0000 (07:58 +0000)
commitd9d855959ef63f1f8c16a711755887e93fe9c169
tree5d97a053041288e3833b273f1aee82b605b15c6f
parentba1793c257ec181823cab7cb2827807c2b8df9df
Migrate to a binary-encoded database format

This approach is very similar to the one that we used before, but instead of storing
IP addresses as two integers, they are encoded as a big-endian 128 bit long binary
"string".

This is then stored as the BLOB data type of sqlite which has fewer limitations in
length, can be indexed and uses memcmp() which should be at least as fast as comparing
integers.

This allows a slightly easier query and seems to me significantly faster than the
PostgreSQL approach.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
tools/base.py