{"id":19458510,"url":"https://github.com/postgrespro/undam","last_synced_at":"2026-03-11T04:31:46.384Z","repository":{"id":149601162,"uuid":"245410862","full_name":"postgrespro/undam","owner":"postgrespro","description":"Undo storage implementation","archived":false,"fork":false,"pushed_at":"2020-12-08T19:36:21.000Z","size":439,"stargazers_count":14,"open_issues_count":3,"forks_count":6,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-10-01T23:57:10.278Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/postgrespro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-06T12:12:28.000Z","updated_at":"2025-02-07T15:07:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"7c5784fa-f7bf-402a-8653-e9e6ae067085","html_url":"https://github.com/postgrespro/undam","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/postgrespro/undam","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postgrespro%2Fundam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postgrespro%2Fundam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postgrespro%2Fundam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postgrespro%2Fundam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/postgrespro","download_url":"https://codeload.github.com/postgrespro/undam/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postgrespro%2Fundam/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30370797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"online","status_checked_at":"2026-03-11T02:00:07.027Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T17:27:24.078Z","updated_at":"2026-03-11T04:31:46.362Z","avatar_url":"https://github.com/postgrespro.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is PostgreSQL extension implementing UNDO storage based on table-AM API.\nThe primary goal is to address write amplification problem.\nRight now Postgres MVCC implementation is creating new version of the object for\neach update and unused version are collected later by vacuum.\nHot update mechanism is used to avoid insertion of new versions in indexes\nbut it is applicable only when version is located at the same page as update record.\nAlso hot updates does't eliminate table bloating on frequent updates.\n\nUndam storage performs in-place update and stores old versions in undo chains.\nAlso tuple is splitted in fixed size chunks linked in L1-list.\nSo TOAST is not needed.\n\nUndam relation is stored in two forks: main fork is used only for tuples headers\n(first tuple chunk).  Tail chunks as well as undo versions are stored in the extension fork.\nOld versions are also linked in L1 UNDO list. This list is traversed by transaction\nwhich snapshot precedes creation of the last version and by vacuum.\n\nUnfortunately current table-AM was developed mostly for hot-update model and doesn't\nallow to update individual indexes which keys are affected by update.\nIt certainly limits advantages of Undam storage.\n\nUndam storage is using the same visibility checking mechanism as standard PostgreSQL\nheap (based on tuple's XMIN/XMAX and snapshots).\n\nUndam storage also requires vacuum which freeze old tuples and truncated unneeded undo chains.\n\nUndam use fixed size allocator for relation chunks.\nHead of the listis stored in one of root pages of relations.\nTo prevent this root page from becoming battelenck we use several lists (undam.alloc_chains),\nheader of each is stored in its own root page. List is choosed randomely.\nList with index K is used for allocation of pages which (blockno % undam.alloc_chains) == K.\n\nUndam storage is using generic WAL messages to provide ACID transaction behavior.\nAs far as it never shift data on the page, generic WAL messages delta calculation mechanism\nis quite efficient in this case.\n\n[UNDAM presentation](https://docs.google.com/presentation/d/1ho7NFVY02WHyGfYz-30NmhbhzaA7yzYCPOQTgS6p3XI/edit?usp=sharing)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostgrespro%2Fundam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpostgrespro%2Fundam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostgrespro%2Fundam/lists"}