antirez/redis — pull request #452 by dmelikyan (2012-04-12 21:34:37+00:00)
Title: RANGES argument for ZINTERSTORE

Coded simple enhancement to ZINTERSTORE. Main idea behind this is to intersect large zsets faster and using less memory by avoiding intermediate operations. It also makes some new query based data models possible (without scripting). Here is what it looks like:

ZINTERSTORE out 2 zset1 zset2 RANGES 1 10 5 25

It will do interstore on subsets of zset1 with scores between 1 to 10 and zset2 with scores between 5 and 25. Score ranges are specified the same way as in other commands using numbers, infinities and exclusion.

The worst case time complexity does not change.