On Sun, Feb 6, 2011 at 11:03 AM, Shaun Cutts <sh...@cuttshome.net> wrote: > What I think you should be doing is the following: open iterators on the > matching keys for each of the indexes; the inside loop would pick an iterator > at random, and pull a match from it. This would assure that the expected > number of entries examined is a small multiple (# of other indexes) of the > index with the most "precision".
Isn't this a bad approximation of performing an intersection by iterating through each index results (which, since they return in sorted order, can be done without horrible memory cost)? I'm not opposed to doing that. But I have no idea how to guess when that is better than the current inner-loop method. > I know you have a new type of index in the works... but it doesn't look like > "trunk" has any modifications for "scan", and presumably the strategy I just > mentioned is pretty general (not depending on histograms, etc). Does it sound > like a good idea? I think you're thinking of https://issues.apache.org/jira/browse/CASSANDRA-1472, and my understanding is that the bitmap approach basically does what you want only faster. -- Jonathan Ellis Project Chair, Apache Cassandra co-founder of DataStax, the source for professional Cassandra support http://www.datastax.com