cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Shuler (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CASSANDRA-7148) Auto pagination finds 999 791 out of 1 000 000 rows
Date Tue, 29 Jul 2014 23:12:39 GMT

     [ https://issues.apache.org/jira/browse/CASSANDRA-7148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Michael Shuler resolved CASSANDRA-7148.
---------------------------------------

    Resolution: Incomplete

Closing as incomplete.  Please, feel free to re-open this issue with some additional info
as requested, if you still need some help in determining if this is indeed a bug or just a
usage issue.  Thanks!

> Auto pagination finds 999 791 out of 1 000 000 rows
> ---------------------------------------------------
>
>                 Key: CASSANDRA-7148
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7148
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: bodrin
>
> In a cluster of 3 nodes cassandra 2.0.6 with replication factor=3 and with the following
schema:
> CREATE TABLE IF NOT EXISTS test (
> 	org varchar,
> 	department varchar,
> 	id varchar,
> 	area varchar,
> 	value text, // json
> 	PRIMARY KEY ((org), department, id)
> );
> CREATE INDEX IF NOT EXISTS ON test(area);
> I have inserted 1 000 000 rows this way:
> String insert = "INSERT INTO test (org, department, id, area, value) VALUES (?, ?, ?,
?, ?)";
>       for (int organization = 0; organization < 500; organization++) {
>          for (int department = 0; department < 2; department++) {
>             for (int area = 0; area < 2; area++) {
>                for (int id = 0; id < 500; id++) {
> 					String orgValue = "org" + organization;
> 					String departmentValue = "department" + department;
> 					String areaValue = "area" + area;
> 					String idValue = UUID.randomUUID().toString();
> 					// insert a single row here
> ...
> Then just read them all:
>       int count = 0;
>       ResultSet rs = session.execute("select * from test limit 1000000");
>       Iterator<Row> i = rs.iterator();
>       while (i.hasNext()) {
>          Row row = i.next();
>          count++;
>       }
> 	  
> and the count is 999791 (this tooks 33 seconds)
> while at the same time 
> cqlsh:t2> select count(*) from test limit 1000000;
>  count
> ---------
>  1000000
>  I have also verified that all the queries of kind
>  select * from test where area=areaXXX
>  return 500 entries as expected and 2000*500 is 1 000 000



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

Mime
View raw message