Re: Modeling contact list, plain table or List

2016-01-12 Thread DuyHai Doan
e base table as the MV > PK. But still working fine. > > > That is my first Cassandra use case and the guidance provided by you guys > pretty important. > > Thanks very much for the answers, questions and suggestions. > > > -- > IPVP > > > From: DuyHai Doan > R

Re: Modeling contact list, plain table or List

2016-01-12 Thread I PVP
assandra.apache.org ><mailto:user@cassandra.apache.org> Date: January 12, 2016 at 10:27:45 AM To: user@cassandra.apache.org ><mailto:user@cassandra.apache.org> Cc: Jack Krupansky ><mailto:jack.krupan...@gmail.com> Subject: Re: Modeling contact list, plain table or List 1)SELEC

Re: Modeling contact list, plain table or List

2016-01-12 Thread DuyHai Doan
ly with the select requirements? >> >> Thanks >> -- >> IPVP >> >> >> From: Jack Krupansky >> >> Reply: user@cassandra.apache.org > >> >> Date: January 11, 2016 at 7:00:04 PM >> >> To: user@cassandra.apache.org > &

Re: Modeling contact list, plain table or List

2016-01-11 Thread Jonathan Haddad
> Reply: user@cassandra.apache.org > > > Date: January 11, 2016 at 7:00:04 PM > > To: user@cassandra.apache.org > > > Subject: Re: Modeling contact list, plain table or List > > That's the beauty of MV - Cassandra automatically updates the MVs when the > base table c

Re: Modeling contact list, plain table or List

2016-01-11 Thread Jack Krupansky
ate: January 11, 2016 at 7:00:04 PM > > To: user@cassandra.apache.org > > > Subject: Re: Modeling contact list, plain table or List > > That's the beauty of MV - Cassandra automatically updates the MVs when the > base table changes, including deletions, which is why all

Re: Modeling contact list, plain table or List

2016-01-11 Thread I PVP
: user@cassandra.apache.org ><mailto:user@cassandra.apache.org> Date: January 11, 2016 at 7:00:04 PM To: user@cassandra.apache.org ><mailto:user@cassandra.apache.org> Subject: Re: Modeling contact list, plain table or List That's the beauty of MV - Cassandra automatically updates the MVs

Re: Modeling contact list, plain table or List

2016-01-11 Thread Jack Krupansky
rite IS NOT NULL AND contactname IS NOT > NULL > PRIMARY KEY ( ( userid, isfavorite ), contactname ) > WITH CLUSTERING ORDER BY ( contactname DESC ) > > Thanks > > -- > IPVP > > > From: DuyHai Doan > Reply: user@cassandra.apache.org > > > Date: January

Re: Modeling contact list, plain table or List

2016-01-11 Thread I PVP
a.apache.org> Subject: Re: Modeling contact list, plain table or List In the current iteration of materialized view, it is still not possible to have WHERE clause other than IS NOT NULL so is_favourite IS TRUE won't work. Still there is a JIRA created to support this feature : https://

Re: Modeling contact list, plain table or List

2016-01-11 Thread DuyHai Doan
gt;> by contact_name like this ? : >>>> >>>> CREATE TABLE communication.user_contact_list ( >>>> user_id uuid, >>>> contact_name text, >>>> is_favorite boolean, >>>> contact_id uuid, >>>> created_at timeuuid, >>

Re: Modeling contact list, plain table or List

2016-01-11 Thread Jack Krupansky
R BY (contact_name ASC); >>> >>> Query: Select * from user_contact_list where user_id = :userid and >>> is_favorite = true order by contact_name asc; >>> >>> Looks like each contact as a row/clustering key will be the way to go. >>> >>> Thanks >>

Re: Modeling contact list, plain table or List

2016-01-11 Thread Carlos Alonso
re user_id = :userid and >> is_favorite = true order by contact_name asc; >> >> Looks like each contact as a row/clustering key will be the way to go. >> >> Thanks >> >> IPVP >> >> >> From: Laing, Michael >> >> Reply: user@cassandra.ap

Re: Modeling contact list, plain table or List

2016-01-10 Thread DuyHai Doan
rg > > > Date: January 9, 2016 at 11:51:27 AM > To: user@cassandra.apache.org > > > Subject: Re: Modeling contact list, plain table or List > > Note that in C* 3.02 the second query is invalid: > > cqlsh> Select * from communication.user_contact_list where us

Re: Modeling contact list, plain table or List

2016-01-09 Thread Isaac P .
: Laing, Michael <mailto:michael.la...@nytimes.com> Reply: user@cassandra.apache.org ><mailto:user@cassandra.apache.org> Date: January 9, 2016 at 11:51:27 AM To: user@cassandra.apache.org ><mailto:user@cassandra.apache.org> Subject: Re: Modeling contact list, plain table

Re: Modeling contact list, plain table or List

2016-01-09 Thread Laing, Michael
Note that in C* 3.02 the second query is invalid: cqlsh> Select * from communication.user_contact_list where user_id = 98f50f00-b6d5-11e5-afec-6003089bf572 and is_favorite = true order by contact_name asc; *InvalidRequest: code=2200 [Invalid query] message="PRIMARY KEY column "is_favorite" cannot

Re: Modeling contact list, plain table or List

2016-01-08 Thread Jack Krupansky
How big is each contact list expected to be? Dozens? Hundreds? Thousands? If just dozens, a simple list column would seem sufficient. If thousands, the row (not partition) would get kind of bloated. What requirements do you have for updating? If updating contacts and lots of contacts, I think I'd

Modeling contact list, plain table or List

2016-01-08 Thread Isaac P .
Hi everyone What would perform better while modeling a simple user contact list that will be used mainly to select the recipients for/from/to messages ? a) Individual rows to each (user, contact) pair so a select would fetch all the rows to retrieve all the contacts from a given user. or b)