cassandra - Query all rows with first item of compound partition key only -


i have following column family:

create table test."data" (     "itemid" uuid,     "dataid" uuid,     primary key (("itemid", "dataid")) ) 

i want rows having "itemsourceid" = someuuid.

before, had following schema, , working great obviously:

create table test."data" (     "itemid" uuid,     "dataid" uuid,     primary key (itemid, "dataid") 

but had lot of performance issues because there many rows specific itemid (several millions).

i wondering if following requests allow me results specific itemid or if not possible:

select * "data" token("itemid", "dataid") > token(e9e9ebfd-c9aa-11e4-b1a1-b8e85641b1e0, 00000000-0000-0000-0000-000000000000) limit 1000; 

and replacing 00000000-0000-0000-0000-000000000000 last uuid until there's no result itemid anymore. basic paginating.

i results right don't know if i'll of them since i'm not sure how token works , if 00000000-0000-0000-0000-000000000000 first.

i using cassandra 2.1.4.

thank help

using itemid partition key , dataid clustering key data model want consider. benchmarks i've seen last september indicate having "millions" of cells in partition should ok in modern versions of cassandra, long they're not tombstones (you can patrick mcfadin's talk @ cassandra summit 2014 in sf last september details).

iterating using token fallback, don't think can guarantee uuid of 0s first - you'd want select token limit 1 find absolute lowest, , use resulting token in subsequent selects.

personally, i'd try breaking partition manually - dataid time based (type 1 uuids?). if so, i'd try breaking partition logical date blocks (such 1 partition per day).


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -