cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-6825) Slice Queries Can Skip Intersecting SSTables
Date Wed, 02 Apr 2014 13:37:16 GMT


Sylvain Lebresne commented on CASSANDRA-6825:

I'm not sure the example above is really the one you meant (because I believe that the current
code does return that there is intersection for that example), I think you meant something
along the lines of a slice of say {{((1, 3), "")}} with min={{(0, 1)}} and max={{(3, 2)}},
but I agree there's a problem.

The patch looks mostly good, but regarding the "optimization" inner loop in CompositeType.intersects,
I believe it could be simplified to:
for (int i = 0; i < Math.min(Math.min(start.length, finish.length), minColumnNames.size());
    AbstractType<?> t = types.get(i);
    if ([i], finish[i]) != 0)

    // we already know the first component falls within its min/max range (otherwise we wouldn't
get here)
    if (i > 0 && !t.intersects(minColumnNames.get(i), maxColumnNames.get(i), start[i],
        continue outer;
Note in particular that we shouldn't assume that minColumnNames/maxColumnNames length is always
bigger or equal that the slice bounds. But +1 if we agree on that change.

> Slice Queries Can Skip Intersecting SSTables
> --------------------------------------------
>                 Key: CASSANDRA-6825
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>         Environment: quad core Windows7 x64, single node cluster
> Cassandra 2.0.5
>            Reporter: Bill Mitchell
>            Assignee: Tyler Hobbs
>             Fix For: 2.0.7, 2.1 beta2
>         Attachments: 6825-2.0.txt, cassandra.log,, selectrowcounts.txt,,
> Investigating another problem, I needed to do COUNT(*) on the several partitions of a
table immediately after a test case ran, and I discovered that count(*) on the full table
and on each of the partitions returned different counts.  
> In particular case, SELECT COUNT(*) FROM sr LIMIT 1000000; returned the expected count
from the test 99999 rows.  The composite primary key splits the logical row into six distinct
partitions, and when I issue a query asking for the total across all six partitions, the returned
result is only 83999.  Drilling down, I find that SELECT * from sr WHERE s = 5 AND l = 11
AND partition = 0; returns 30,000 rows, but a SELECT COUNT(*) with the identical WHERE predicate
reports only 14,000. 
> This is failing immediately after running a single small test, such that there are only
two SSTables, sr-jb-1 and sr-jb-2.  Compaction never needed to run.  
> In selectrowcounts.txt is a copy of the cqlsh output showing the incorrect count(*) results.

This message was sent by Atlassian JIRA

View raw message