incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tyler Hobbs <>
Subject Re: Resetting a counter in CQL
Date Sat, 01 Mar 2014 00:38:23 GMT
On Fri, Feb 28, 2014 at 6:32 PM, Clint Kelly <> wrote:

> What is the best known method for resetting a counter in CQL?  Is it best
> to read the counter and then increment it by a negative amount?

Do this.

>   Or to delete the row and then increment it by zero?

Don't do this.  When you delete a counter, you are basically saying "I will
never use this counter again".  If you try to use it again, the behavior is
undefined. It's one of the documented limitations of counters.

Tyler Hobbs
DataStax <>

View raw message