Thanks. Yes I know it's by no means trivial. I thought in case there was an
index on the column on which I want to place condition, the index machinery
itself can do the counting (i.e. when the index is updated, the counter is
incremented). It doesn't seem too orthogonal to the current implementation,
at least from my very limited experience.

It's actually not that easy in Cassandra since a main feature is that the writes
don't imply a read. But if you want your index to count the number of row where
foo=bar, you need when a new column foo=bar is written to know if the column
did not exist already in this row, in which cas you should not increment. Similarly,
if you write foo=42, you need to check if the previous value was foo=bar and if
yes decrement your index.