2
votes

With the Cassandra database system, is it okay to use a boolean valued column as a clustering column (as part of the primary key)? The column will of course not be a partition key, but just one of a bunch of clustering columns.

Is it a negative regarding performance or other considerations?

2

2 Answers

2
votes

Yes, that's is ok to use boolean as one of the clustering columns, especially if you have several

2
votes

Echoing what Alex said, I think it's ok.

The only negatives I can see, is if:

  1. The number of possible values under that particular value is large.
  2. The boolean column is your only clustering column.

For example, keeping a roster of people in your co-ed softball team (or even a league, for that matter) wouldn't generate enough rows to be a problem. But if a large social network site implemented it for their user database, that likely would not perform well. Again though, this is only if it's the only clustering key.

But in your case, with it being one of multiple clustering keys, I think you'll be fine.