52 Commits

Author SHA1 Message Date
Pieter Noordhuis
ccf96e197b Make zzl API unaware of the robj where the ziplist is stored 2011-03-22 16:09:21 +01:00
Pieter Noordhuis
8f0a41be98 Encode sorted set after loading from dump 2011-03-22 16:09:21 +01:00
Pieter Noordhuis
63b29390b2 Convert encoding of result when in limits 2011-03-22 16:08:42 +01:00
Pieter Noordhuis
46aa0e2472 Remove comment 2011-03-22 16:08:03 +01:00
Pieter Noordhuis
07d9e35637 Generic iterator code for usage in ZUNIONSTORE/ZINTERSTORE 2011-03-22 16:08:03 +01:00
Pieter Noordhuis
2e12082b3e Make zzlLength take a ziplist argument 2011-03-22 16:08:03 +01:00
Pieter Noordhuis
771ea6e1a6 Fix used function in ZCARD 2011-03-22 16:08:03 +01:00
Pieter Noordhuis
c5802e3f4a Convert encoding when thresholds overflow 2011-03-22 16:08:03 +01:00
Pieter Noordhuis
a3886e29a6 Support dual encoding for more commands 2011-03-22 16:06:07 +01:00
Pieter Noordhuis
db912c5a93 Support dual encoding for ZRANGEBYSCORE et al 2011-03-22 16:06:07 +01:00
Pieter Noordhuis
2165ac5573 Helpers to move around in encoded sorted set 2011-03-22 16:06:07 +01:00
Pieter Noordhuis
f8224a4f90 Support dual encoding for ZREMRANGEBYRANK 2011-03-22 16:06:07 +01:00
Pieter Noordhuis
679de7ae2f Support dual encoding for ZRANGE 2011-03-22 16:05:45 +01:00
Pieter Noordhuis
0b8c9eac68 Look up and remove elements by range 2011-03-22 16:05:45 +01:00
Pieter Noordhuis
4c36024f51 Typo 2011-03-22 16:05:05 +01:00
Pieter Noordhuis
8e1db6a05f Little less obfuscation 2011-03-22 16:05:05 +01:00
Pieter Noordhuis
d3882605c0 Support dual encoding in ZREM 2011-03-22 16:05:05 +01:00
Pieter Noordhuis
3d6eade781 Don't encode element argument when dealing with ziplist 2011-03-22 16:04:33 +01:00
Pieter Noordhuis
6b017e615f Initial work for ziplist backed sorted sets 2011-03-22 16:04:33 +01:00
Pieter Noordhuis
5b40d6e656 Rename zset range functions 2011-03-22 16:03:22 +01:00
Pieter Noordhuis
8c3b630561 Test for ranges where min > max 2011-03-22 16:03:22 +01:00
Pieter Noordhuis
4484e3b591 Compiler should decide on inlining 2011-03-22 16:03:22 +01:00
Pieter Noordhuis
453a906fc9 Move logic concerned with zset ranges
This also optimizes ZREVRANGEBYSCORE for pathological cases where a
sorted set contains many elements with the same score. Previously,
it would traverse the list from back to front in such a case.
2011-03-22 16:03:22 +01:00
Pieter Noordhuis
3becef9ee6 Reverse commits changing sorted set code for 2.2 2011-01-17 11:15:50 +01:00
Pieter Noordhuis
1b2b8cbbde Compiler should decide on inlining 2011-01-13 16:06:03 +01:00
Pieter Noordhuis
4769dc7826 Undo rename of function names where something went wrong 2010-12-09 10:37:35 +01:00
Pieter Noordhuis
039357e471 Move logic concerned with zset ranges
This also optimizes ZREVRANGEBYSCORE for pathological cases where a
sorted set contains many elements with the same score. Previously,
it would traverse the list from back to front in such a case.
2010-12-07 23:21:07 +01:00
antirez
21dbc6499a merge conflict resolved 2010-10-28 22:59:47 +02:00
Pieter Noordhuis
75b41de8ca Convert objects in the command procs instead of the protocol code 2010-10-17 17:21:41 +02:00
Pieter Noordhuis
7236fdb22f Return error when min and/or max in the sorted set range spec is not a double 2010-10-13 21:59:24 +02:00
Pieter Noordhuis
91504b6cbe Make ZREMRANGEBYSCORE accept the same range spec as ZRANGEBYSCORE
This allows to use inclusive/exclusive bounds for min and max when
deleting a range of scores from a sorted set.
2010-10-13 21:43:58 +02:00
Pieter Noordhuis
26f3388d27 Merge branch 'master' into zrevrangebyscore 2010-10-13 20:29:50 +02:00
antirez
50a9fad5d5 two leaks fixed 2010-09-22 17:49:04 +02:00
antirez
beb7756dcb error generation format reverted to the new style after merge 2010-09-22 16:10:13 +02:00
antirez
b882056c93 Merge remote branch 'pietern/zset-mem' 2010-09-22 16:09:33 +02:00
antirez
5ca2f0c498 preventive conflict resolution to merge pietern/zset-mem 2010-09-22 16:09:30 +02:00
Pieter Noordhuis
d433ebc681 Finished code for sorted set memory efficiency 2010-09-16 15:42:36 +02:00
Pieter Noordhuis
25bb8a4452 Add ZREVRANGEBYSCORE and refactor Z*RANGEBYSCORE 2010-09-16 14:38:07 +02:00
Pieter Noordhuis
192fc3376a Merge branch 'zset-mem' into zrevrangebyscore 2010-09-16 14:32:30 +02:00
Pieter Noordhuis
3ab203762f Use specialized function to add status and error replies 2010-09-02 23:33:06 +02:00
Pieter Noordhuis
b70d355521 Use existing reply functions where possible 2010-09-02 19:52:04 +02:00
Pieter Noordhuis
0537e7bf80 Use specialized function to add multi bulk reply length 2010-09-02 12:51:14 +02:00
Pieter Noordhuis
b301c1fc2b Wrapper for adding unknown multi bulk length to reply list 2010-08-30 16:39:14 +02:00
Pieter Noordhuis
69ef89f2cf Reference zset score in zskiplistNode from dict entries
This avoids the extra allocation of sizeof(double) for storing the score
of a zset entry in the hash table. Saves sizeof(double) + malloc
overhead = approx. 16 bytes per zset entry.
2010-08-03 20:49:53 +02:00
Pieter Noordhuis
2159782b51 Use flexible array in zskiplistNode to reduce memory usage 2010-08-03 19:22:09 +02:00
Pieter Noordhuis
673e1fb7e4 Change getDoubleFromObject to fail on NaN.
Return an error when the resulting value is not a number (NaN). Fix
ZUNIONSTORE/ZINTERSTORE to clean up when a weight argument is not a
double value.
2010-07-29 23:05:01 +02:00
Pieter Noordhuis
d9e28bcf00 Fix ZUNIONSTORE/ZINTERSTORE to never store a NaN score.
When +inf and -inf are added, the result is NaN. We don't want NaN
scores in a sorted set, so agreed on the result of this operation being
zero.
2010-07-29 23:03:11 +02:00
antirez
cbf7e1070a fix of the fix for the replication bug 2010-07-28 18:56:52 +02:00
antirez
8c1420ff2a Fixed a replication bug in ZINTERSTORE.
In order to trigger the bug what's needed is to call ZINTERSTORE
resulting into an empty set created, bug against a key that already
existed. The command was not propagated, so the replica ended with the
key that the master removed. Sequence of command to reproduce:

redis-cli hset 446 34 905
redis-cli hset 446 393 911
redis-cli zadd 966 0.085412045980529885 652
redis-cli zadd 645 0.25081839284432045 280
redis-cli zinterstore 446 2 966 645
2010-07-28 18:42:02 +02:00
antirez
5b4bff9c17 WATCH is now affected only when write commands actually modify the key content 2010-07-12 12:01:15 +02:00