Re: Query first 1 columns for each partitioning keys in CQL?

2014-05-19 Thread Bryan Talbot
I think there are several issues in your schema and queries. First, the schema can't efficiently return the single newest post for every author. It can efficiently return the newest N posts for a particular author. On Fri, May 16, 2014 at 11:53 PM, 後藤 泰陽 wrote: > > But I consider LIMIT to be a

Re: Query first 1 columns for each partitioning keys in CQL?

2014-05-17 Thread Matope Ono
Hmm. Something like a user-managed-index looks the only way to do what I want to do. Thank you, I'll try that. 2014-05-17 18:07 GMT+09:00 DuyHai Doan : > Clearly with your current data model, having X latest post for each author > is not possible. > > However, what's about this ? > > CREATE TAB

Re: Query first 1 columns for each partitioning keys in CQL?

2014-05-17 Thread DuyHai Doan
Clearly with your current data model, having X latest post for each author is not possible. However, what's about this ? CREATE TABLE latest_posts_per_user ( author ascii latest_post map, PRIMARY KEY (author) ) The latest_post will keep a collection of X latest posts for each user. No

Re: Query first 1 columns for each partitioning keys in CQL?

2014-05-17 Thread 後藤 泰陽
Hello, Thank you for your addressing. But I consider LIMIT to be a keyword to limits result numbers from WHOLE results retrieved by the SELECT statement. The result with SELECT.. LIMIT is below. Unfortunately, This is not what I wanted. I wante latest posts of each authors. (Now I doubt if CQL3

Query first 1 columns for each partitioning keys in CQL?

2014-05-16 Thread Matope Ono
Hi, I'm modeling some queries in CQL3. I'd like to query first 1 columns for each partitioning keys in CQL3. For example: create table posts( > author ascii, > created_at timeuuid, > entry text, > primary key(author,created_at) > ); > insert into posts(author,created_at,entry) values > ('john',m

Re: Query first 1 columns for each partitioning keys in CQL?

2014-05-16 Thread Jonathan Lacefield
Hello, Have you looked at using the CLUSTERING ORDER BY and LIMIT features of CQL3? These may help you achieve your goals. http://www.datastax.com/documentation/cql/3.1/cql/cql_reference/refClstrOrdr.html http://www.datastax.com/documentation/cql/3.1/cql/cql_reference/select_r.html Jonathan