Re: Indexes on heterogeneous rows

2011-04-17 Thread Jonathan Ellis
Right. On Sun, Apr 17, 2011 at 4:23 AM, David Boxenhorn wrote: > Thanks, Jonathan. I think I understand now. > > To sum up: Everything would work, but if your only equality is on "type" > (all the rest inequalities), it could be very inefficient. > > Is that right? > > On Thu, Apr 14, 2011 at 7:2

Re: Indexes on heterogeneous rows

2011-04-17 Thread David Boxenhorn
Thanks, Jonathan. I think I understand now. To sum up: Everything would work, but if your only equality is on "type" (all the rest inequalities), it could be very inefficient. Is that right? On Thu, Apr 14, 2011 at 7:22 PM, Jonathan Ellis wrote: > On Thu, Apr 14, 2011 at 6:48 AM, David Boxenho

Re: Indexes on heterogeneous rows

2011-04-15 Thread Wangpei (Peter)
Boxenhorn; aaron morton 主题: Re: Indexes on heterogeneous rows This should work reasonably well w/ 0.7 indexes. Cassandra tracks statistics on index selectivity, so it would plan that query as "index lookup on e=5, then iterate over those results and return only rows that also have type=2.&quo

Re: Indexes on heterogeneous rows

2011-04-14 Thread aaron morton
lumn values >> http://www.datastax.com/dev/blog/whats-new-cassandra-07-secondary-indexes >> >> So you could create secondary indexes on the a,e, and h columns and get rows >> that have specific values. There are some limitations to secondary indexes, >> read the li

Re: Indexes on heterogeneous rows

2011-04-14 Thread Jonathan Ellis
On Thu, Apr 14, 2011 at 6:48 AM, David Boxenhorn wrote: > The reason why I put "type" first is that queries on type will > always be an exact match, whereas the other clauses might be inequalities. Expression order doesn't matter, but as you imply, non-equalities can't be used in an index lookup

Re: Indexes on heterogeneous rows

2011-04-14 Thread Jonathan Ellis
he a,e, and h columns and get >> rows that have specific values. There are some limitations to secondary >> indexes, read the linked article. >> Or you can make your own secondary indexes using row keys as the index >> values. >> If you have billions of rows, how many d

Re: Indexes on heterogeneous rows

2011-04-14 Thread David Boxenhorn
og/whats-new-cassandra-07-secondary-indexes >> >> So you could create secondary indexes on the a,e, and h columns and get >> rows that have specific values. There are some limitations to secondary >> indexes, read the linked article. >> >> Or you can make your own s

Re: Indexes on heterogeneous rows

2011-04-14 Thread aaron morton
e specific values. There are some limitations to secondary indexes, > read the linked article. > > Or you can make your own secondary indexes using row keys as the index values. > > If you have billions of rows, how many do you need to read back at once? > > Hope that h

Re: Indexes on heterogeneous rows

2011-04-14 Thread David Boxenhorn
he linked article. > > Or you can make your own secondary indexes using row keys as the index > values. > > If you have billions of rows, how many do you need to read back at once? > > Hope that helps > Aaron > > On 14 Apr 2011, at 04:23, David Boxenhorn wrote: >

Re: Indexes on heterogeneous rows

2011-04-14 Thread aaron morton
icle. Or you can make your own secondary indexes using row keys as the index values. If you have billions of rows, how many do you need to read back at once? Hope that helps Aaron On 14 Apr 2011, at 04:23, David Boxenhorn wrote: > Is it possible in 0.7.x to have indexes on heterogeneou

Indexes on heterogeneous rows

2011-04-13 Thread David Boxenhorn
Is it possible in 0.7.x to have indexes on heterogeneous rows, which have different sets of columns? For example, let's say you have three types of objects (1, 2, 3) which each had three members. If your rows had the following pattern type=1 a=? b=? c=? type=2 d=? e=? f=? type=3 g=?