cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-7148) Auto pagination finds 999 791 out of 1 000 000 rows
Date Mon, 05 May 2014 07:39:15 GMT

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

Sylvain Lebresne commented on CASSANDRA-7148:
---------------------------------------------

Have you tried using QUORUM consistency for writes and reads instead of CAS? You might also
want to give a shot at C* 2.0.7 too since there has been a few paging related fix in that
release.

> 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