Skip to content

Instantly share code, notes, and snippets.

@klizhentas
Created September 11, 2013 19:09
Show Gist options
  • Save klizhentas/6528324 to your computer and use it in GitHub Desktop.
Save klizhentas/6528324 to your computer and use it in GitHub Desktop.
Counters with TTL
CREATE TABLE hits (
hit text PRIMARY KEY,
counter counter
) WITH COMPACT STORAGE;
UPDATE hits USING TTL 3600 SET counter = counter + 1 WHERE hit='api-call-some-hour';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment