Skip to content

Check timestamp columns if they contain old data #28

@macbre

Description

@macbre
  • report if there are rows matching date < NOW() - INTERVAL 1825 DAY (5 years) - table has really old data, worth checking if such long data retention is actually needed - data_too_old
  • report if there no rows matching date > NOW() - INTERVAL 30 DAY (a month) - table is no longer updated, worth checking if it's still needed - data_not_updated_recently
  • allow to customise the thresholds via environment variables (in days) - INDEX_DIGEST_DATA_TOO_OLD_THRESHOLD_DAYS / INDEX_DIGEST_DATA_NOT_UPDATED_RECENTLY_THRESHOLD_DAYS
mysql@geo-db-specials-master.query.consul[specials]>select max(timestamp) from jobs_summary;
+---------------------+
| max(timestamp)      |
+---------------------+
| 2012-10-05 15:30:56 |
+---------------------+
1 row in set (0.27 sec)

Wikia/app@aa3264e#diff-a8a96815bb2aff4701306b5e9ebff53cL66

Guard behind --analyze-data cli flag (as this can take a while on large tables where timestamp column is not a part of an index)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions