Re: Order By limitation or bug?

2015-09-07 Thread Robert Wille
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

Re: Order By limitation or bug?

2015-09-04 Thread Tyler Hobbs
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

Re: Order By limitation or bug?

2015-09-03 Thread DuyHai Doan
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

Re: Order By limitation or bug?

2015-09-03 Thread Robert Wille
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

Order By limitation or bug?

2015-09-03 Thread Robert Wille
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:

Re: Order By limitation or bug?

2015-09-03 Thread DuyHai Doan
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

RE: Order By limitation or bug?

2015-09-03 Thread Alec Collier
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