cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Mitchell (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-6825) COUNT(*) with WHERE not finding all the matching rows
Date Fri, 21 Mar 2014 08:21:46 GMT

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

Bill Mitchell commented on CASSANDRA-6825:
------------------------------------------

Tyler, you use an interesting word, "flush".  After running a test with a different database
name, I went back and looked at the first keyspace, as I did not drain the node before zipping
the file the first time.  A third SSTable had now been written.  See the larger .zip file
I have attached.  When I try the same statements through cqlsh, a SELECT * FROM sr WHERE ...
AND partition = 2 now shows 20000 rows, but SELECT COUNT(*) FROM sr WHERE ... AND partition=2
still returns a count of 10000.  So the count is still incorrect.  

> COUNT(*) with WHERE not finding all the matching rows
> -----------------------------------------------------
>
>                 Key: CASSANDRA-6825
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6825
>             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
>         Attachments: cassandra.log, selectpartitions.zip, selectrowcounts.txt, testdb_1395372407904.zip,
testdb_1395372407904.zip
>
>
> 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
(v6.2#6252)

Mime
View raw message