You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Serega Sheypak <se...@gmail.com> on 2015/04/08 10:27:21 UTC

OrderPreservingPartitioner and compound partition key

Hi imagine I have a table "events"
with fields:
ymd int
user_id uuid
ts timestamp
attr_1
attr_2

with primary key ((ymd, user_id, ts))
and I set OrderPreservingPartitioner as a partitioner for the table

ymd is int representation for the day: 20150410, 20150411, e.t.c.

Can I select from table using just ymd field?

select * from events
where ymd = 20150410

Re: OrderPreservingPartitioner and compound partition key

Posted by Serega Sheypak <se...@gmail.com>.
I understand the reason, but If I user OrderPreservingPartitioner and have
compound partition key, can I use select using only FIRST component of
compound partition key?

2015-04-08 20:43 GMT+02:00 Robert Coli <rc...@eventbrite.com>:

> On Wed, Apr 8, 2015 at 1:27 AM, Serega Sheypak <se...@gmail.com>
> wrote:
>
>> and I set OrderPreservingPartitioner as a partitioner for the table
>>
>
> As a general statement, you almost certainly do not want to use the
> OrderPreservingPartitioner for any purpose.
>
> It should probably be called the
> DontUseThisIfYouWantMostOfTheAdvantagesOfADistributedSystemPartitioner.
>
> =Rob
>
>

Re: OrderPreservingPartitioner and compound partition key

Posted by Robert Coli <rc...@eventbrite.com>.
On Wed, Apr 8, 2015 at 1:27 AM, Serega Sheypak <se...@gmail.com>
wrote:

> and I set OrderPreservingPartitioner as a partitioner for the table
>

As a general statement, you almost certainly do not want to use the
OrderPreservingPartitioner for any purpose.

It should probably be called the
DontUseThisIfYouWantMostOfTheAdvantagesOfADistributedSystemPartitioner.

=Rob