What are the maximum number of columns allowed in Cassandra
Asked Answered
A

3

7

Cassandra published its technical limitations but did not mention the max number of columns allowed. Is there a maximum number of columns? I have a need to store 400+ fields. Is this possible in Cassandra?

Aphis answered 19/5, 2015 at 3:16 Comment(1)
possible duplicate of Limit on the number of columns in cassandraPoliti
V
8

The maximum number of columns per row (or a set of rows, which is called "partition" in Cassandra's CQL) is 2 billion (but the partition must also fit on a physical node, see docs).

400+ fields is not a problem.

Voncile answered 19/5, 2015 at 5:6 Comment(0)
L
7

As per Cassandra technical limitation page, total no. of cells together cannot exceed 2 billion cells (rows X columns).

You can have a table with (1 row X 2 billion columns) and no more rows will be allowed in that table, so the limit is not 2 billion columns per row but limit is on total no. of cells in a partition.

https://wiki.apache.org/cassandra/CassandraLimitations

Lawana answered 7/9, 2018 at 0:43 Comment(0)
M
2

Rajmohan's answer is technically correct. On the other hand, if you have 400 CQL columns, you most likely aren't optimizing your data model. You want to generate cassandra wide rows using partition keys and clustering columns in CQL.

Moreover, you don't want to have rows that are too wide from a practical (performance) perspective. A conservative rule of thumb is keep your partitions under the 100's of megs or 100,000's of cells.

Take a look at these two links to help wrap your head around this.

http://www.datastax.com/dev/blog/does-cql-support-dynamic-columns-wide-rows

http://www.sestevez.com/sestevez/CASTableSizer/

Myers answered 19/5, 2015 at 5:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.