Re: 答复: 答复: A difficult data model with C*

2016-11-10 Thread Benjamin Roth
>* wrote >>> >>> The solution maybe work. However, the play list will grow over time and >>> somebody maybe has ten thousands that will slow down the query and sort . >>> Do you mean the oldest one should be removed when a new play is added? >>> >>> BTW, the ve

Re: 答复: 答复: A difficult data model with C*

2016-11-10 Thread Gang Liu
that will slow down the query and sort . >> Do you mean the oldest one should be removed when a new play is added? >> >> BTW, the version is 2.1.16 in our live system. >> >> >> BRs, >> >> BEN >> -- >> >>

Re: 答复: 答复: A difficult data model with C*

2016-11-10 Thread Benjamin Roth
gt; >>> On Wed, 09 Nov 2016 20:47:05 -0500*Diamond ben >>> >* wrote >>> >>> The solution maybe work. However, the play list will grow over time and >>> somebody maybe has ten thousands that will slow down the query and sort . >>> Do you

Re: 答复: 答复: A difficult data model with C*

2016-11-10 Thread Carlos Alonso
list will grow over time and >>> somebody maybe has ten thousands that will slow down the query and sort . >>> Do you mean the oldest one should be removed when a new play is added? >>> >>> BTW, the version is 2.1.16 in our live system. >>> >>> >

Re: 答复: 答复: A difficult data model with C*

2016-11-10 Thread Benjamin Roth
removed when a new play is added? >> >> BTW, the version is 2.1.16 in our live system. >> >> >> BRs, >> >> BEN >> -- >> >> *发件人:* Vladimir Yudovin >> *发送时间:* 2016年11月9日 18:11:26 >> *收件人:* user

Re: 答复: 答复: A difficult data model with C*

2016-11-10 Thread Carlos Alonso
ten thousands that will slow down the query and sort . > Do you mean the oldest one should be removed when a new play is added? > > BTW, the version is 2.1.16 in our live system. > > > BRs, > > BEN > -- > > *发件人:* Vladimir Yudovin >

Re: 答复: 答复: A difficult data model with C*

2016-11-10 Thread Vladimir Yudovin
is added? BTW, the version is 2.1.16 in our live system. BRs, BEN 发件人: Vladimir Yudovin <vla...@winguzone.com> 发送时间: 2016年11月9日 18:11:26 收件人: user 主题: Re: 答复: A difficult data model with C* You are welcome! ) >recent ten movies watched by the user within 30 days. In this ca

答复: 答复: A difficult data model with C*

2016-11-09 Thread Diamond ben
发件人: Vladimir Yudovin 发送时间: 2016年11月9日 18:11:26 收件人: user 主题: Re: 答复: A difficult data model with C* You are welcome! ) >recent ten movies watched by the user within 30 days. In this case you can't use PRIMARY KEY (user_name, video_id), as video_id is demanded to fetch row

Re: 答复: A difficult data model with C*

2016-11-09 Thread Vladimir Yudovin
BEN 发件人: Vladimir Yudovin <vla...@winguzone.com> 发送时间: 2016年11月8日 22:35:48 收件人: user 主题: Re: A difficult data model with C* Hi Ben, if need very limited number of positions (as you said ten) may be you can store them in LIST of UDT? Or just as JSON string? So you'll have

答复: A difficult data model with C*

2016-11-08 Thread ben ben
e and continue to watch from the last position she/he did. BTW, a movie can be watched several times by a user and the last positon is needed indeed. BRs, BEN 发件人: Vladimir Yudovin 发送时间: 2016年11月8日 22:35:48 收件人: user 主题: Re: A difficult data model with C* H

Re: A difficult data model with C*

2016-11-08 Thread Vladimir Yudovin
Hi Ben, if need very limited number of positions (as you said ten) may be you can store them in LIST of UDT? Or just as JSON string? So you'll have one row per each pair user-video. It can be something like this: CREATE TYPE play (position int, last_time timestamp); CREATE TABLE recent

Re: A difficult data model with C*

2016-11-07 Thread Mickael Delanoë
Which version of Cassandra are you using? If this is a 3.0 or higher, why don't you create a materialized view for ypur base table with the last time as the first clustering colum? However : It need to be confirmed if this is not an anti-pattern for cassandra as this materialized view will have a

Re: A difficult data model with C*

2016-11-07 Thread Dikang Gu
Agree, change the last_time to be descending order will help, you can also TTL the data, so that the old records will be purged by Cassandra. --Dikang. On Mon, Nov 7, 2016 at 10:39 PM, Alain Rastoul wrote: > On 11/08/2016 03:54 AM, ben ben wrote: > >> Hi guys, >>CREATE TABLE recent ( >>

Re: A difficult data model with C*

2016-11-07 Thread Alain Rastoul
On 11/08/2016 03:54 AM, ben ben wrote: Hi guys, CREATE TABLE recent ( user_name text, vedio_id text, position int, last_time timestamp, PRIMARY KEY (user_name, vedio_id) ) Hi Ben, May be a clustering columns order would help CREATE TABLE recent ( ... ) WITH CLUSTER

A difficult data model with C*

2016-11-07 Thread ben ben
Hi guys, We are maintaining a system for an on-line video service. ALL users' viewing records of every movie are stored in C*. So she/he can continue to enjoy the movie from the last point next time. The table is designed as below: CREATE TABLE recent ( user_name text, vedio_id text,