You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by ma...@sandbox-interactive.com on 2018/06/05 21:32:42 UTC
Data Model for One To Many - Itemcontainer - Items
hi,
i have two CFs "ItemContainer" and "Items".
I used to have a secondary index in "Items" referring to the
"Itemcontainer". Something like:
CREATE table items (key uuid primary key, container uuid, slot int ....
CREATE INDEX items_container ON items(container)
i change the "container" cell quite often when changing the
itemcontainer. Documentation says that a secondary index shouldnt be
used in this case.
So i tried something like:
primary key(container, key)
in items. now i can query all items for an itemcontainer just fine.
but how do i put the item in another itemcontainer? you cant override
parts of the primary key. so do i really have to delete the item and
reinsert all the date with a different "container" field?
Doesn't this create a lot of tombstones? Also "Items" has like 20
columns with maps and lists and everything...
any ideas?
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
For additional commands, e-mail: user-help@cassandra.apache.org