Pagination

2017-06-20 Thread web master
I am migrating from MySql to Cassandra , In mysql I use OFFSET and LIMIT to paginate , the problem is that we have Android client that request next page and POST to server OFFSET and LIMIT so I don't know how can I migrate to Cassandra and keep backward compatibility Is there any technique for the

Ordering by last inserted row

2017-06-20 Thread web master
I have this schema CREATE TABLE IF NOT EXISTS "blog" ( blog_id INT, post_id INT, body TEXT, PRIMARY KEY (blog_id,post_id) )WITH CLUSTERING ORDER BY (post_id DESC); I want to get sorted list of blog_id by post_id , that means If I have blog_id IN (1,2,3,4,5,6,7,8,9,

LIKE

2017-06-20 Thread web master
I have this table CREATE TABLE users_by_username ( username text PRIMARY KEY, email text, age int ) I want to run query like the following select username from users where username LIKE 'shl%' LIMIT 10; Always , I want to find only 10 username (Case insensitive) that start with spe

COUNT

2017-06-20 Thread web master
I have this schema CREATE TABLE IF NOT EXISTS "inbox" ( "groupId" BIGINT, "createTime" TIMEUUID, "mailId" BIGINT, "body" TEXT, PRIMARY KEY ("groupId","createTime","mailId") )WITH CLUSTERING ORDER BY ("createTime" DESC); This table

Count limit

2017-06-20 Thread web master
According to http://www.maigfrga.ntweb.co/counting-indexing-and- ordering-cassandra SELECT COUNT(*) FROM product limit 5000; must return no more than 5000 , but Why it don't works? and count whole number? Some body told because the count return 1 row result and some body told that it is a bug in

Question about materialized view

2017-06-20 Thread web master
Assume this schema CREATE TABLE t( a int, b int, c int, d int, e text, f date, g int, PRIMARY KEY (a,b) ) I we create following mv CREATE MATERIALIZED VIEW t_mv as select a,b,c,d from t where c is not null and d is not null

tombstone limit reaches 100K cells

2017-06-20 Thread web master
Accoding to http://docs.datastax.com/en/cql/3.1/cql/ddl/ddl_when_use_ index_c.html#concept_ds_sgh_yzz_zj__upDatIndx > Cassandra stores tombstones in the index until the tombstone limit reaches 100K cells. After exceeding the tombstone limit, the query that uses the indexed value will fail. 1- Is

Ask for suggestions to de-duplicate data for Cassandra CDC

2017-06-20 Thread Jay Zhuang
Hi, For Cassandra CDC feature: http://cassandra.apache.org/doc/latest/operating/cdc.html The CDC data is duplicated RF number of times. Let's say replication factor is 3 in one DC, the same data will be sent out 3 times. One solution is adding another DC with RF=1, which will be only used for CDC

RE: Best practice to add(bootstrap) multiple nodes to cluster at once

2017-06-20 Thread ZAIDI, ASAD A
adding multiple nodes at once tax system more and caused me issues on existing nodes. I prefer to add one node at a time … From: techpyaasa . [mailto:techpya...@gmail.com] Sent: Tuesday, June 20, 2017 9:32 AM To: user@cassandra.apache.org Subject: Best practice to add(bootstrap) multiple nodes t

RE: Secondary Index

2017-06-20 Thread ZAIDI, ASAD A
Hey there – Like other suggested before adding more index , look for opportunity to de-normalize your data model OR create composite keys for your primary index – if that works for you. Secondary index are there so you can leverage them they come with cost. They’re difficult to manage , as you

Best practice to add(bootstrap) multiple nodes to cluster at once

2017-06-20 Thread techpyaasa .
Hi, What is the best practice to add(bootstrap) multiple nodes at once to c* cluster. Using c*-2.1.17 , 2 DCs , 3 groups in each DC Thanks TechPyaasa

Re: Question: Behavior of inserting a list multiple times with same timestamp

2017-06-20 Thread Thakrar, Jayesh
Ok, tried the test again, w/o the TIMESTAMP, and got the expected behavior. Apparently, the INSERT does replace the entire list if no timestamp is specified (as expected). However, if the TIMESTAMP is specified, then it does (what appears to be) an append. But found even more weird issue - see la

Re: Large temporary files generated during cleaning up

2017-06-20 Thread Alain RODRIGUEZ
Hi Simon, I know for sure that clean up (like compaction) need to copy the entire SSTable (Data + index) excepted from the part being evicted by the cleanup. As SSTables are immutable, to manipulate (remove) data, cleanup like compaction need to copy the data we want to keep before removing the o

Re: Secondary Index

2017-06-20 Thread Eduardo Alonso
Hi: If you model your table with 'status' as the partitiion key you are limiting your cluster. If status only has 5 posible values, every insert will be assigned only to 5 nodes. So, you will not use your cluster resources correctly. create table ks1.sta1(status int,id1 bigint,id2 binint,resp tex

Re: Secondary Index

2017-06-20 Thread @Nandan@
Hi , Better you can go with denormalized the data based on status. create table ks1.sta1(status int,id1 bigint,id2 binint,resp text,primary key(status,id1)); This will allow you to do as you want.. select * from ks1.sta1 where status = 0 and id1 = 123; Please make sure, that (status and id1) gives

Re: Secondary Index

2017-06-20 Thread techpyaasa .
Hi ZAIDI, Thanks for reply. Sorry I didn't get your line "You can get away the potential situation by leveraging composite key, if that is possible for you?" How can I get through it?? Like I have a table as below CREATE TABLE ks1.cf1 (id1 bigint, id2 bigint, resp text, status int, PRIMARY KEY (