Re: [EXTERNAL] Re: Tracing in cassandra

2018-10-12 Thread Nitan Kainth
Try query with partition key selection in where clause. But time for limit 11 
shouldn’t fail. Are all nodes up? Do you see any corruption in ay sstable?

Sent from my iPhone

> On Oct 12, 2018, at 11:40 AM, Abdul Patel  wrote:
> 
> Sean,
> 
> here it is :
> CREATE TABLE Keyspave.tblname (
> user_id bigint,
> session_id text,
> application_guid text,
> last_access_time timestamp,
> login_time timestamp,
> status int,
> terminated_by text,
> update_time timestamp,
> PRIMARY KEY (user_id, session_id)
> ) WITH CLUSTERING ORDER BY (session_id ASC)
> 
> also they see timeouts with limit 11 as well, so is it better to remove with 
> limit option ? or whats best to query such schema?
> 
>> On Fri, Oct 12, 2018 at 11:05 AM Durity, Sean R 
>>  wrote:
>> Cross-partition = multiple partitions
>> 
>>  
>> 
>> Simple example:
>> 
>> Create table customer (
>> 
>> Customerid int,
>> 
>> Name text,
>> 
>> Lastvisit date,
>> 
>> Phone text,
>> 
>> Primary key (customerid) );
>> 
>>  
>> 
>> Query
>> 
>> Select customerid from customer limit 5000;
>> 
>>  
>> 
>> The query is asking for 5000 different partitions to be selected across the 
>> cluster. This is a very EXPENSIVE query for Cassandra, especially as the 
>> number of nodes goes up. Typically, you want to query a single partition. 
>> Read timeouts are usually caused by queries that are selecting many 
>> partitions or a very large partition. That is why a schema for the involved 
>> table could help.
>> 
>>  
>> 
>>  
>> 
>> Sean Durity
>> 
>>  
>> 
>> From: Abdul Patel  
>> Sent: Friday, October 12, 2018 10:04 AM
>> To: user@cassandra.apache.org
>> Subject: [EXTERNAL] Re: Tracing in cassandra
>> 
>>  
>> 
>> Cpuld you elaborate cross partition query?
>> 
>> On Friday, October 12, 2018, Durity, Sean R  
>> wrote:
>> 
>> I suspect you are doing a cross-partition query, which will not scale well 
>> (as you can see). What is the schema for the table involved?
>> 
>>  
>> 
>>  
>> 
>> Sean Durity
>> 
>>  
>> 
>> From: Abdul Patel  
>> Sent: Thursday, October 11, 2018 5:54 PM
>> To: a...@instaclustr.com
>> Cc: user@cassandra.apache.org
>> Subject: [EXTERNAL] Re: Tracing in cassandra
>> 
>>  
>> 
>> Query :
>> 
>> SELECT * FROM keysoace.tablenameWHERE user_id = 390797583 LIMIT 5000; 
>> 
>> -Error: ReadTimeout: Error from server: code=1200 [Coordinator node timed 
>> out waiting for replica nodes' responses] message="Operation timed out - 
>> received only 0 responses." info={'received_responses': 0, 
>> 'required_responses': 1, 'consistency': 'ONE'}
>> 
>>  
>> 
>> e70ac650-cd9e-11e8-8e99-15807bff4dfd | e70bd7c0-cd9e-11e8-8e99-15807bff4dfd 
>> | 
>> Parsing SELECT * FROM keysoace.tablenameWHERE user_id = 390797583 LIMIT 
>> 5000; | 10.54.145.32 |   4020 |   
>> Native-Transport-Requests-3
>> 
>> e70ac650-cd9e-11e8-8e99-15807bff4dfd | e70bfed0-cd9e-11e8-8e99-15807bff4dfd 
>> |
>> Preparing statement | 
>> 10.54.145.32 |   5065 |   Native-Transport-Requests-3
>> 
>> e70ac650-cd9e-11e8-8e99-15807bff4dfd | e70c25e0-cd9e-11e8-8e99-15807bff4dfd 
>> |
>>  Executing single-partition query on roles | 
>> 10.54.145.32 |   6171 |   ReadStage-2
>> 
>> e70ac650-cd9e-11e8-8e99-15807bff4dfd | e70c4cf0-cd9e-11e8-8e99-15807bff4dfd 
>> |
>>Acquiring sstable references | 
>> 10.54.145.32 |   6362 |   ReadStage-2
>> 
>> e70ac650-cd9e-11e8-8e99-15807bff4dfd | e70c4cf1-cd9e-11e8-8e99-15807bff4dfd 
>> |  
>> Skipped 0/2 non-slice-intersecting sstables, included 0 due to tombstones | 
>> 10.54.145.32 |   6641 |   ReadStage-2

Re: [EXTERNAL] Re: Tracing in cassandra

2018-10-12 Thread Abdul Patel
Sean,

here it is :
CREATE TABLE Keyspave.tblname (
user_id bigint,
session_id text,
application_guid text,
last_access_time timestamp,
login_time timestamp,
status int,
terminated_by text,
update_time timestamp,
PRIMARY KEY (user_id, session_id)
) WITH CLUSTERING ORDER BY (session_id ASC)

also they see timeouts with limit 11 as well, so is it better to remove
with limit option ? or whats best to query such schema?

On Fri, Oct 12, 2018 at 11:05 AM Durity, Sean R 
wrote:

> Cross-partition = multiple partitions
>
>
>
> Simple example:
>
> Create table customer (
>
> Customerid int,
>
> Name text,
>
> Lastvisit date,
>
> Phone text,
>
> Primary key (customerid) );
>
>
>
> Query
>
> Select customerid from customer limit 5000;
>
>
>
> The query is asking for 5000 different partitions to be selected across
> the cluster. This is a very EXPENSIVE query for Cassandra, especially as
> the number of nodes goes up. Typically, you want to query a single
> partition. Read timeouts are usually caused by queries that are selecting
> many partitions or a very large partition. That is why a schema for the
> involved table could help.
>
>
>
>
>
> Sean Durity
>
>
>
> *From:* Abdul Patel 
> *Sent:* Friday, October 12, 2018 10:04 AM
> *To:* user@cassandra.apache.org
> *Subject:* [EXTERNAL] Re: Tracing in cassandra
>
>
>
> Cpuld you elaborate cross partition query?
>
> On Friday, October 12, 2018, Durity, Sean R 
> wrote:
>
> I suspect you are doing a cross-partition query, which will not scale well
> (as you can see). What is the schema for the table involved?
>
>
>
>
>
> Sean Durity
>
>
>
> *From:* Abdul Patel 
> *Sent:* Thursday, October 11, 2018 5:54 PM
> *To:* a...@instaclustr.com
> *Cc:* user@cassandra.apache.org
> *Subject:* [EXTERNAL] Re: Tracing in cassandra
>
>
>
> Query :
>
> SELECT * FROM keysoace.tablenameWHERE user_id = 390797583 LIMIT 5000;
>
> -Error: ReadTimeout: Error from server: code=1200 [Coordinator node timed
> out waiting for replica nodes' responses] message="Operation timed out -
> received only 0 responses." info={'received_responses': 0,
> 'required_responses': 1, 'consistency': 'ONE'}
>
>
>
> e70ac650-cd9e-11e8-8e99-15807bff4dfd |
> e70bd7c0-cd9e-11e8-8e99-15807bff4dfd
> |
> Parsing SELECT * FROM keysoace.tablenameWHERE user_id = 390797583 LIMIT
> 5000; | 10.54.145.32 |   4020 |
> Native-Transport-Requests-3
>
> e70ac650-cd9e-11e8-8e99-15807bff4dfd |
> e70bfed0-cd9e-11e8-8e99-15807bff4dfd
> |
> Preparing statement |
> 10.54.145.32 |   5065 |
> Native-Transport-Requests-3
>
> e70ac650-cd9e-11e8-8e99-15807bff4dfd |
> e70c25e0-cd9e-11e8-8e99-15807bff4dfd |
>   
> Executing
> single-partition query on roles | 10.54.145.32 |   6171
> |   ReadStage-2
>
> e70ac650-cd9e-11e8-8e99-15807bff4dfd |
> e70c4cf0-cd9e-11e8-8e99-15807bff4dfd
> |
> Acquiring sstable references | 10.54.145.32 |   6362
> |   ReadStage-2
>
> e70ac650-cd9e-11e8-8e99-15807bff4dfd |
> e70c4cf1-cd9e-11e8-8e99-15807bff4dfd
> |
> Skipped 0/2 non-slice-intersecting sstables, included 0 due to tombstones |
> 10.54.145.32 |   6641 |
> ReadStage-2
>
> e70ac650-cd9e-11e8-8e99-15807bff4dfd |
> e70c4cf2-cd9e-11e8-8e99-15807bff4dfd
> |
> Key cache hit for sstable 346 | 10.54.145.32 |   6955
> |   ReadStage-2
>
> e70ac650-cd9e-11e8-8e99-15807bff4dfd |
> e70c4cf3-cd9e-11e8-8e99-15807bff4dfd
> |
>Bloom filter allows skipping sstable 347 | 10.54.145.32
> |   7202 |   ReadStage-2
>
> e70ac650-cd9e-11e8-8e99-15807bff4dfd |
> e70c7400-cd9e-11e8-8e99-15807bff4dfd
> |
>   Merged data
> from memtables and 2 sstables | 10.54.145.32 |   7386
> |   ReadStage-2
>
> e70ac650-cd9e-11e8-8e99-15807bff4dfd |
> e70c7401-cd9e-11e8-8e99-15807bff4dfd
> |
> Read 1 live and 0 tombstone cells | 10.54.145.32 |   7519
> |   ReadStage-2
>
> e70ac650-cd9e-11e8-8e99-15807bff4dfd |
> e70c7402-cd9e-11e8-8e99-15807bff4dfd
> |
> Executing single-partition query on roles | 10.54.145.32 |   7826
> |   ReadStage-4
>
> e70ac650-cd9e-11e8-8e99-15807bf