You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Roshan <co...@gmail.com> on 2012/05/04 03:07:42 UTC

Misleading CQL behaviour regarding LIMIT clause

Hi

I have created a CF and it has around 10 million rows. But If I try to
select statement with the LIMIT 100, it returns 79 records. Don't know why
this behavior? 

*Statement I used:*
SELECT * FROM ActivityLog WHERE userid = '%s' AND created >= '%s' AND
created <= '%s' LIMIT 100

*CF Structure*
create column family ActivityLog
    with comparator = UTF8Type
    and column_metadata = [
	{column_name : userid,
        validation_class : BytesType,
        index_name : userid_idx,
        index_type : KEYS},
	{column_name : workspace,
        validation_class : BytesType,
        index_name : workspace_idx,
        index_type : KEYS},
	{column_name : module,
        validation_class : BytesType,
        index_name : module_idx,
        index_type : KEYS},
	{column_name : action,
        validation_class : BytesType,
        index_name : action_idx,
        index_type : KEYS},		
	{column_name : status,
        validation_class : BytesType,
        index_name : status_idx,
        index_type : KEYS},		
	{column_name : created,
        validation_class : BytesType,
        index_name : created_idx,
        index_type : KEYS},		
	{column_name : description,
		validation_class : BytesType},		
	{column_name : logdetail,
        validation_class : BytesType}]
    and keys_cached = 200000
    and rows_cached = 0
    and row_cache_save_period = 0
    and key_cache_save_period = 3600
	and gc_grace = 3600
    and memtable_throughput = 255
    and memtable_operations = 0.29
	and compression_options={sstable_compression:SnappyCompressor,
chunk_length_kb:64};

Any help is appreciated.

Thanks.

--
View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Misleading-CQL-behaviour-regarding-LIMIT-clause-tp7525626.html
Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.

Re: Misleading CQL behaviour regarding LIMIT clause

Posted by Eric Evans <ee...@acunu.com>.
On Thu, May 3, 2012 at 8:07 PM, Roshan <co...@gmail.com> wrote:
> I have created a CF and it has around 10 million rows. But If I try to
> select statement with the LIMIT 100, it returns 79 records. Don't know why
> this behavior?
>
> *Statement I used:*
> SELECT * FROM ActivityLog WHERE userid = '%s' AND created >= '%s' AND
> created <= '%s' LIMIT 100

My guess would be that, total number of rows in the columnfamily
notwithstanding, there are only 79 for the given the predicates.

-- 
Eric Evans
Acunu | http://www.acunu.com | @acunu