Skip to content
This repository has been archived by the owner on Dec 14, 2022. It is now read-only.

Add database garbage collector to delete expired records #21

Open
jrconlin opened this issue Jun 4, 2018 · 3 comments
Open

Add database garbage collector to delete expired records #21

jrconlin opened this issue Jun 4, 2018 · 3 comments
Labels
2 semi-trivial chore Dependency updates, and other maintenance tasks enhancement New feature or request p1

Comments

@jrconlin
Copy link
Member

jrconlin commented Jun 4, 2018

Can currently be done with a cronjob that runs:

DELETE from pushboxv1 where TTL < unix_timestamp();

but it might be nice to add that to pushbox.

@jrconlin jrconlin added enhancement New feature or request p3 labels Jun 4, 2018
@edunham
Copy link

edunham commented Apr 30, 2019

Prepping for migration:

MySQL [pushbox]> SELECT COUNT(*) from pushboxv1 where TTL < unix_timestamp();
+----------+
| COUNT(*) |
+----------+
|  1387743 |
+----------+
1 row in set (0.60 sec)

MySQL [pushbox]> SELECT COUNT(*) from pushboxv1;
+----------+
| COUNT(*) |
+----------+
|  1796240 |
+----------+
1 row in set (0.32 sec)
MySQL [pushbox]> SELECT COUNT(*) from pushboxv1 where TTL >= unix_timestamp();
+----------+
| COUNT(*) |
+----------+
|   408490 |
+----------+
1 row in set (0.62 sec)

@jrconlin jrconlin added 2 semi-trivial chore Dependency updates, and other maintenance tasks p2 labels Jun 24, 2020
@jrconlin
Copy link
Member Author

Upping priority on this based on https://bugzilla.mozilla.org/show_bug.cgi?id=1642855

@jrconlin jrconlin added p1 and removed p2 p3 labels Jun 24, 2020
@pjenvey
Copy link
Member

pjenvey commented Jun 24, 2020

TTL lacks an index, we should also add one for this

jrconlin added a commit that referenced this issue Jun 24, 2020
jrconlin added a commit that referenced this issue Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
2 semi-trivial chore Dependency updates, and other maintenance tasks enhancement New feature or request p1
Projects
None yet
Development

No branches or pull requests

3 participants