Macquarie Group Limited •
From: Robert Wille [mailto:rwi...@fold3.com<mailto:rwi...@fold3.com>]
Sent: Friday, 4 September 2015 7:17 AM
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: Re: Order By limitation or bug?
If you only specify the partition key, and
Alec Collier* | Workplace Service Design
>
> Corporate Operations Group - Technology | Macquarie Group Limited £
>
>
>
> *From:* Robert Wille [mailto:rwi...@fold3.com]
> *Sent:* Friday, 4 September 2015 7:17 AM
> *To:* user@cassandra.apache.org
> *Subject:* Re: Or
Limitation, not bug. The reason ?
On disk, data are sorted by type first, and FOR EACH type value, the data
are sorted by id.
So to do an order by Id, C* will need to perform an in-memory re-ordering,
not sure how bad it is for performance. In any case currently it's not
possible, maybe you
If you only specify the partition key, and none of the clustering columns, you
can order by in either direction:
SELECT data FROM import_file WHERE roll = 1 order by type;
SELECT data FROM import_file WHERE roll = 1 order by type DESC;
These are both valid. Seems like specifying the prefix of
Given this table:
CREATE TABLE import_file (
roll int,
type text,
id timeuuid,
data text,
PRIMARY KEY ((roll), type, id)
)
This should be possible:
SELECT data FROM import_file WHERE roll = 1 AND type = 'foo' ORDER BY id DESC;
but it results in the following error:
Bad Request:
It's normal, type is the FIRST clustering column so on disk, data are
sorted first by "type" naturally. C* does not have to perform any sorting
in memory.
And when you're using "order by type DESC", it's still not sorted in
memory, C* is just doing a backward-scan on disk starting from the
by type.
Alec Collier | Workplace Service Design
Corporate Operations Group - Technology | Macquarie Group Limited *
From: Robert Wille [mailto:rwi...@fold3.com]
Sent: Friday, 4 September 2015 7:17 AM
To: user@cassandra.apache.org
Subject: Re: Order By limitation or bug?
If you only specify