You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Venkata Harikrishna Nukala (JIRA)" <ji...@apache.org> on 2019/05/17 08:08:00 UTC

[jira] [Commented] (CASSANDRA-14516) filter sstables by min/max clustering bounds during reads

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

Venkata Harikrishna Nukala commented on CASSANDRA-14516:
--------------------------------------------------------

I tried to reproduce the issue by following these steps.

1. Create keyspace
{code:java}
CREATE KEYSPACE ks1 WITH replication = {'class': 'SimpleStrategy' , 'replication_factor': 1 };{code}
2. Create table
{code:java}
CREATE TABLE ks1.t1 ( k1 int , c1 int, c2 int, PRIMARY KEY (k1, c1, c2));{code}
3. Insert few rows
{code:java}
INSERT INTO ks1.t1 (k1 , c1 , c2 ) VALUES ( 5, 1, 1);
INSERT INTO ks1.t1 (k1 , c1 , c2 ) VALUES ( 5, 1, 2);
INSERT INTO ks1.t1 (k1 , c1 , c2 ) VALUES ( 5, 2, 3);
INSERT INTO ks1.t1 (k1 , c1 , c2 ) VALUES ( 5, 2, 4);
{code}
4. Nodetool flush.
 5. Insert more rows
{code:java}
INSERT INTO ks1.t1 (k1 , c1 , c2 ) VALUES ( 5, 7, 5);
INSERT INTO ks1.t1 (k1 , c1 , c2 ) VALUES ( 5, 7, 6);
INSERT INTO ks1.t1 (k1 , c1 , c2 ) VALUES ( 5, 8, 7);
INSERT INTO ks1.t1 (k1 , c1 , c2 ) VALUES ( 5, 8, 8);
{code}
6. Nodetool flush.
 7. Now run select command with clustering bounds
{code:java}
SELECT * FROM ks1.t1 WHERE k1 = 5 and c1 > 1 and c1 < 3;

 k1 | c1 | c2
----+----+----
  5 |  2 |  3
  5 |  2 |  4

(2 rows)

Tracing session: bc217bd0-7818-11e9-a606-b7a04374fcea

 activity                                                                                       | timestamp                  | source    | source_elapsed | client
------------------------------------------------------------------------------------------------+----------------------------+-----------+----------------+-----------
                                                                             Execute CQL3 query | 2019-05-17 01:55:24.237000 | 127.0.0.1 |              0 | 127.0.0.1
 Parsing SELECT * FROM ks1.t1 WHERE k1 = 5 and c1 > 1 and c1 < 3; [Native-Transport-Requests-1] | 2019-05-17 01:55:24.238000 | 127.0.0.1 |            321 | 127.0.0.1
                                              Preparing statement [Native-Transport-Requests-1] | 2019-05-17 01:55:24.238000 | 127.0.0.1 |            674 | 127.0.0.1
                                           Executing single-partition query on t1 [ReadStage-2] | 2019-05-17 01:55:24.239000 | 127.0.0.1 |           1402 | 127.0.0.1
                                                     Acquiring sstable references [ReadStage-2] | 2019-05-17 01:55:24.239000 | 127.0.0.1 |           1500 | 127.0.0.1
        Skipped 1/2 non-slice-intersecting sstables, included 0 due to tombstones [ReadStage-2] | 2019-05-17 01:55:24.239000 | 127.0.0.1 |           1654 | 127.0.0.1
                                                      Key cache hit for sstable 1 [ReadStage-2] | 2019-05-17 01:55:24.239000 | 127.0.0.1 |           1787 | 127.0.0.1
                                        Merged data from memtables and 1 sstables [ReadStage-2] | 2019-05-17 01:55:24.240000 | 127.0.0.1 |           2067 | 127.0.0.1
                                           Read 2 live rows and 0 tombstone cells [ReadStage-2] | 2019-05-17 01:55:24.240000 | 127.0.0.1 |           2181 | 127.0.0.1
                                                                               Request complete | 2019-05-17 01:55:24.239666 | 127.0.0.1 |           2666 | 127.0.0.1
{code}
 

I can see one SSTable skipped while executing the query from the trace. Looks like working as expected.

A check is already in the code: [https://github.com/apache/cassandra/blob/b80f6c65fb0b97a8c79f6da027deac06a4af9801/src/java/org/apache/cassandra/db/SinglePartitionReadCommand.java#L650]

> filter sstables by min/max clustering bounds during reads
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-14516
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14516
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Legacy/Local Write-Read Paths
>            Reporter: Blake Eggleston
>            Assignee: Venkata Harikrishna Nukala
>            Priority: Normal
>             Fix For: 4.0
>
>
> In SinglePartitionReadCommand, we don't filter out sstables whose min/max clustering bounds don't intersect with the clustering bounds being queried. This causes us to do extra work on the read path.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org