Commit fb0d5d5
committed
Add first/last timestamps to expire tables
This adds two timestamp (with timezone) columns to all expire tables
called "first" and "last". When an entry is added, both are set to the
current (transaction) timestamp. When an entry already exists a new
insert will result in the "last" timestamp being updated.
Having these two timestamps allows various expire/updating strategies,
for instance:
* update oldest entry
* update entry that didn't change for the longest time
* update older entries but only if there are no recent changes, which
indicates that there might be more changes coming
For backwards compatibility the code detects which table format is used
and falls back to the old behaviour if the timestamp columns aren't
there.1 parent ca7a1df commit fb0d5d5
1 file changed
+25
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
66 | 78 | | |
67 | 79 | | |
68 | 80 | | |
| |||
76 | 88 | | |
77 | 89 | | |
78 | 90 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
85 | 100 | | |
0 commit comments