rpc_timeout for a simple query on cassandra, using an index

187 views Asked by At

here is the model, using cassandra 2.0, cql 3, and only one node :

CREATE TABLE purchase (
  row_id timeuuid,
  date text,
  domain_id text,
  item_id text,
  product_id text,
  purchase_id text,
  stream_id text,
  PRIMARY KEY (row_id)
) WITH
  bloom_filter_fp_chance=0.010000 AND
  caching='KEYS_ONLY' AND
  comment='' AND
  dclocal_read_repair_chance=0.000000 AND
  gc_grace_seconds=864000 AND
  index_interval=128 AND
  read_repair_chance=0.100000 AND
  replicate_on_write='true' AND
  populate_io_cache_on_flush='false' AND
  default_time_to_live=0 AND
  speculative_retry='99.0PERCENTILE' AND
  memtable_flush_period_in_ms=0 AND
  compaction={'class': 'SizeTieredCompactionStrategy'} AND
  compression={'sstable_compression': 'LZ4Compressor'};

CREATE INDEX purchase_date ON purchase (date);

CREATE INDEX purchase_domain ON purchase (domain_id);

all the values of domain_id are the same, so there should be no issue when querying on this field. But I have this:

cqlsh:mykeyspace> select count(*) from purchase limit 1000000;

 count
--------
 114292

So this is not a heavy table, but:

cqlsh:mykeyspace> select * from purchase where domain_id = 'test' limit 5;

 row_id                               | date       | domain_id | item_id   | product_id | purchase_id | stream_id
--------------------------------------+------------+-----------+-----------+------------+-------------+-----------
 090006e0-788f-11e3-a0c1-6142bbb646b5 | 2014-01-01 |     test | 254386500 |   6567576457 |   7654546343 |  purchase
 eb6300b0-788e-11e3-a0c1-6142bbb646b5 | 2014-01-01 |     test | 254386500 |   6567576457 |   7654546343 |  purchase
 fc268980-788e-11e3-a0c1-6142bbb646b5 | 2014-01-01 |     test | 254386500 |   6567576457 |   7654546343 |  purchase
 1fdefe40-7888-11e3-a0c1-6142bbb646b5 | 2014-01-01 |     test | 254386500 |   6567576457 |   7654546343 |  purchase
 f7cc3010-788e-11e3-a0c1-6142bbb646b5 | 2014-01-01 |     test | 254386500 |   6567576457 |   7654546343 |  purchase

 cqlsh:mykeyspace> select count(*) from purchase where domain_id = 'test' limit 1000;

 count
-------
  1000

cqlsh:mykeyspace> select count(*) from purchase where domain_id = 'test' limit 10000;
Request did not complete within rpc_timeout.

It seems the model is correct so I'm wondering what I'm doing wrong.

1

There are 1 answers

0
CassieFan On

Have you tried rebuilding the index and trying again once that finishes using the rebuild_index nodetool command?