[Tile-serving] [openstreetmap/osm2pgsql] Add first/last timestamps to expire tables (PR #2080)

Jochen Topf notifications at github.com
Mon Sep 18 09:17:54 UTC 2023


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.

We are currently not using the timestamps anywhere in osm2pgsql but they can already be used outside osm2pgsql and the generalization code will be able to use these in the future.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/osm2pgsql/pull/2080

-- Commit Summary --

  * Add first/last timestamps to expire tables

-- File Changes --

    M src/expire-output.cpp (35)

-- Patch Links --

https://github.com/openstreetmap/osm2pgsql/pull/2080.patch
https://github.com/openstreetmap/osm2pgsql/pull/2080.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/2080
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/osm2pgsql/pull/2080 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20230918/0c28a877/attachment.htm>


More information about the Tile-serving mailing list