0

I want query similar to this

SELECT uuid,data,name,time,tracker,type,userid FROM standardevents080406 ORDER BY userid DESC;

but it is not working where as simple where clause queries are working.

SELECT uuid,data,name,time,tracker,type,userid FROM standardevents080406 where userid='64419';

am i doing something wrong..

Description of column-family is as below

CREATE TABLE standardevents080406 (   uuid uuid PRIMARY KEY,   data text,   name text,   time text,   tracker text,   type text,   userid text ) 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 time_ind ON standardevents080406 (time);

CREATE INDEX userid_ind ON standardevents080406 (userid);
Helping Hand..
  • 2,430
  • 4
  • 32
  • 52

1 Answers1

1

You can't perform an ORDER BY on a column which is not part of the clustering key. Your table definition does not include any clustering key, but a simple primary key. Sorting, in your situation, can be performed only client-side.

HTH, Carlo

Carlo Bertuccini
  • 19,615
  • 3
  • 28
  • 39