Hi Nail,
nice tests .. and glad to hear all the posititive points (speed,
memory usage, predictable performance) and the negative ones (count(*)
is slow) also.
This is a good example of Redisql's memory optimisations. In this
test, both Redisql and redis have to store pairs of integers, so the
chances for compression are not possible, and both have 2 indexes, the
only way to save memory is by being very exact w/ memory usage in data-
structures ... so I am happy to hear the results of this test, I had
not tested this exact scenario.
ZRANK is equivalent to "SELECT score where obj_id = <random_obj_id>" -
which should outperform ZRANK.
My implementations of "SELECT COUNT(*)" was the quickest one I could
possibly do, so I did not expect optimal performance, but 6 times
slower is bad.
"SELECT COUNT(*)"'s performance can be massively improved, it is just
a question of me spending ?1-2 days? coding it.
The current implementation iterates the B+Tree blindly, whereas
"SELECT COUNT(*)" can be done ignoring all the leaves except the ones
containing "min,max"
This requires a special B+tree iterator ... which is complicated and
really should not be rushed.
Currently each B+tree node holds 256 values, so using this iterator
and counting a range query of 20K would involve iterating through less
than 80 nodes where it now goes through all 20K :)
Is the lack of performance of "SELECT COUNT(*)" a deciding factor for
you?
- Jak