Default behavior
When a table is created, all columns are stored as a single column family. This default approach ensures efficient key-value storage and performance in most cases. However, when frequently updated columns are grouped with seldom updated columns, the seldom updated columns are nonetheless rewritten on every update. Especially when the seldom updated columns are large, it’s more performant to split them into a distinct family.Manual override
Assign column families on table creation
To manually assign a column family on , use theFAMILY keyword.
For example, let’s say we want to create a table to store an immutable blob of data (data BYTES) with a last accessed timestamp (last_accessed TIMESTAMP). Because we know that the blob of data will never get updated, we use the FAMILY keyword to break it into a separate column family:
Assign column families when adding columns
When using the statement to add a column to a table, you can assign the column to a new or existing column family.-
Use the
CREATE FAMILYkeyword to assign a new column to a new family. For example, the following would add adata2 BYTEScolumn to thetesttable above and assign it to a new column family: -
Use the
FAMILYkeyword to assign a new column to an existing family. For example, the following would add aname STRINGcolumn to thetesttable above and assign it to familyf1: -
Use the
CREATE IF NOT EXISTS FAMILYkeyword to assign a new column to an existing family or, if the family doesn’t exist, to a new family. For example, the following would assign the new column to the existingf1family; if that family didn’t exist, it would create a new family and assign the column to it: -
If a column is added to a table and the family is not specified, it will be added to the first column family. For example, the following would add the new column to the
f1family, since that is the first column family:

