Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to model boolean flags in cassandra
    primarykey
    data
    text
    <p>I am running into a strange problem using Cassandra 1.2 (DSE 3.1.1). I have a table called JSESSION and here is the structure:</p> <pre><code>cqlsh&gt; use recommender; cqlsh:recommender&gt; describe table jsession; CREATE TABLE jsession ( sessionid text, accessdate timestamp, atompaths set&lt;text&gt;, filename text, processed boolean, processedtime timestamp, userid text, usertag bigint, PRIMARY KEY (sessionid, accessdate) ) 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 read_repair_chance=0.100000 AND replicate_on_write='true' AND populate_io_cache_on_flush='false' AND compaction={'class': 'SizeTieredCompactionStrategy'} AND compression={'sstable_compression': 'SnappyCompressor'}; CREATE INDEX processed_index ON jsession (processed); </code></pre> <p>You can see that the table is indexed on the field 'processed' which is boolean. When I started coding on this table, the following query used to work fine:</p> <pre><code>cqlsh:recommender&gt; select * from jsession where processed = false limit 100; </code></pre> <p>But now that the size is more than 100,000 (not a large number at all), the query has stopped working suddenly, and I couldn't figure out a workaround yet.</p> <pre><code>cqlsh:recommender&gt; select count(*) from jsession limit 1000000; count -------- 142320 cqlsh:recommender&gt; select * from jsession where processed = false limit 100; Request did not complete within rpc_timeout. </code></pre> <p>I tried several options, to increase the rpc_timout to 60 seconds, also to start Cassandra with more memory (it is 8GB now), but I still have the same problem. Do you have any solution for this?</p> <p>The deeper question is what is the right way to model a boolean field in CQL3 so that I can search for that field and update it as well. I need to set the field 'processed' to true after I have processed that session.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload