Re: Help in c* Data modelling

2017-07-23 Thread @Nandan@
Hi , The best way will go with per query per table plan.. and distribute the common column into both tables. This will help you to support queries as well as Read and Write will be fast. Only Drawback will be, you have to insert common data into both tables at the same time which can be easily

Re: Help in c* Data modelling

2017-07-23 Thread Jonathan Haddad
Using a different table to answer each query is the correct answer here assuming there's a significant amount of data. If you don't have that much data, maybe you should consider using a database like Postgres which gives you query flexibility instead of horizontal scalability. On Sun, Jul 23,

Re: Help in c* Data modelling

2017-07-23 Thread techpyaasa .
Hi vladyu/varunbarala Instead of creating second table as you said can I just have one(first) table below and get all rows with status=0. CREATE TABLE IF NOT EXISTS test.user ( account_id bigint, pid bigint, disp_name text, status int, PRIMARY KEY (account_id, pid) ) WITH CLUSTERING ORDER BY

Re: Help in c* Data modelling

2017-07-23 Thread Vladimir Yudovin
Hi, unfortunately ORDER BY is supported for clustering columns only... Winguzone - Cloud Cassandra Hosting On Sun, 23 Jul 2017 12:49:36 -0400 techpyaasa . techpya...@gmail.com wrote Hi Varun, Thanks a lot for your reply. In this case if I want to update

Re: Help in c* Data modelling

2017-07-23 Thread techpyaasa .
Hi Varun, Thanks a lot for your reply. In this case if I want to update status(status can be updated for given account_id, pid) , I need to delete existing row in 2nd table & add new one... :( :( Its like hitting cassandra twice for 1 change.. :( On Sun, Jul 23, 2017 at 8:42 PM, Varun

Re: Help in c* Data modelling

2017-07-23 Thread Varun Barala
Hi, You can create pseudo index table. IMO, structure can be:- CREATE TABLE IF NOT EXISTS test.user ( account_id bigint, pid bigint, disp_name text, status int, PRIMARY KEY (account_id, pid) ) WITH CLUSTERING ORDER BY (pid ASC); CREATE TABLE IF NOT EXISTS test.user_index ( account_id bigint,

Help in c* Data modelling

2017-07-22 Thread techpyaasa .
Hi , We have a table like below : CREATE TABLE ks.cf ( accountId bigint, pid bigint, dispName text, status > int, PRIMARY KEY (accountId, pid) ) WITH CLUSTERING ORDER BY (pid ASC); We would like to have following queries possible on the above table: select * from site24x7.wm_current_status