[ 
https://issues.apache.org/jira/browse/CASSANDRA-6906?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13958114#comment-13958114
 ] 

Tyler Hobbs commented on CASSANDRA-6906:
----------------------------------------

bq. milliseconds? Something is wrong if so.

Yes, 0.1 seconds.  Here's an example trace of {{select * from system.local}} on 
a 15 node cluster with vnodes enabled:
{noformat}
 activity                                                                       
                 | timestamp    | source    | source_elapsed
-------------------------------------------------------------------------------------------------+--------------+-----------+----------------
                                                                              
execute_cql3_query | 15:05:55,295 | 127.0.0.1 |              0
                                                 Parsing select * from 
system.local LIMIT 10000; | 15:05:55,297 | 127.0.0.1 |           1884
                                                                             
Preparing statement | 15:05:55,299 | 127.0.0.1 |           3772
                                                                   Determining 
replicas to query | 15:05:55,300 | 127.0.0.1 |           4435
 Executing seq scan across 3 sstables for [min(-9223372036854775808), 
min(-9223372036854775808)] | 15:05:55,437 | 127.0.0.1 |         141652
                                                     Seeking to partition 
beginning in data file | 15:05:55,440 | 127.0.0.1 |         145212
                                                     Seeking to partition 
beginning in data file | 15:05:55,440 | 127.0.0.1 |         145274
                                                     Seeking to partition 
beginning in data file | 15:05:55,440 | 127.0.0.1 |         145309
                                                              Read 1 live and 0 
tombstoned cells | 15:05:55,451 | 127.0.0.1 |         156072
                                                                    Scanned 1 
rows and matched 1 | 15:05:55,451 | 127.0.0.1 |         156269
                                                                                
Request complete | 15:05:55,455 | 127.0.0.1 |         160916
{noformat}

I agree that this could probably be greatly optimized in other ways as well.

> Skip Replica Calculation for Range Slice on LocalStrategy Keyspace
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-6906
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6906
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Tyler Hobbs
>            Assignee: Tyler Hobbs
>            Priority: Minor
>             Fix For: 2.0.7, 2.1 beta2
>
>         Attachments: 6906.txt
>
>
> For vnode-enabled clusters, the "Determining replicas to query" portion of 
> range slice commands can be expensive.  When querying LocalStrategy 
> keyspaces, we can safely skip this step.  On a 15 node cluster with vnodes, 
> skipping this saves about 100ms.  This makes a big difference for the 
> drivers, which frequently execute queries like "select * from system.peers" 
> and "select * from system.local".



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to