Created
November 9, 2010 16:57
-
-
Save JakSprats/669378 to your computer and use it in GitHub Desktop.
fk range query count(*) test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CLI=./redisql-cli | |
$CLI CREATE TABLE test "(obj_id int primary key, score int)" | |
$CLI CREATE INDEX test_score_idx ON test \(score\) | |
I=0; | |
while [ $I -lt 10 ]; do | |
N=$[${I}*10000]; | |
J=$[${I}+1] | |
M=$[${J}*10000]; | |
while [ $N -le $M ]; do | |
$CLI INSERT INTO test VALUES "($N,$I)"; | |
N=$[${N}+1]; | |
done; | |
echo sleep 30 - to free up sockets | |
sleep 30 | |
I=$[${I}+1]; | |
done | |
I=0; | |
while [ $I -lt 10 ]; do | |
time $CLI SELECT "COUNT(*)" FROM test where "score BETWEEN 0 AND $I"; | |
I=$[${I}+1]; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment