|
When you use composite keys in CQL, Cassandra supports wide Cassandra rows using composite column names. In CQL 3, a primary key can have any number (1 or more) of component columns, but there must be at least one column in the column family that is not part of the primary key. The new wide row technique consumes more storage because for every piece of data stored, the column name is stored along with it.- CREATE TABLE History.events (
- event uuid PRIMARY KEY,
- author varchar,
- body varchar);
- CREATE TABLE timeline (
- user varchar,
- event uuid,
- author varchar,
- body varchar,
复制代码 HotTip
Wide-Row indexes can cause hotspots in the cluster. Since the index is a single row, it is stored on a single node (plus replicas). If that is a heavily used index, those nodes may be overwhelmed. |
|