Urgent.News

What's breaking now, across thousands of outlets.

Tech

OrioleDB Multi-Version Concurrency Control

MVCC not only tracks row history but also records the search-key space. To better understand PostgreSQL MVCC, it's useful to look at some alternatives. One is zheap, which introduced out-of-place undo logging to rebuild historical row versions by storing old tuples in an undo log instead of the heap. This was done entirely at the table access method level, without modifying the index access…

OrioleDB is a PostgreSQL table access method that replaces the traditional heap structure with version-aware B-trees. This allows for multi-version concurrency control (MVCC) where historical row versions are preserved. The database does this by storing complete rows in the primary B-tree and native secondary indexes store the secondary key plus the primary key. This layout is similar to InnoDB's clustered index, but the key difference is how OrioleDB maintains old snapshots as rows, keys, and B-tree pages change.

Two types of history are kept in OrioleDB: row-level undo and page-level undo. Row-level undo reconstructs older tuple values, while page-level undo reconstructs older B-tree leaf contents and key ranges. The latter is particularly interesting as it allows OrioleDB to preserve where an old query would have found a row.

The problem arises when trying to determine if a snapshot should enumerate a row in a previous status. PostgreSQL handles this by retaining old heap tuples and index entries until they are safe to remove. InnoDB does this by keeping old secondary records as delete-marked entries. OrioleDB, on the other hand, uses page-level undo to reconstruct the historical searchable key space.

The primary B-tree stores complete rows, with the key being the primary key or an internal key if no primary key is defined. Native secondary leaves store the secondary key and primary key. This allows the secondary B-tree to route rows to the correct snapshot.

OrioleDB supports PostgreSQL's extensive ecosystem of index types by using a bridge index. An ordinary index stores a synthetic heap-shaped bridge_ctid, while an internal OrioleDB bridge tree maps this identifier to the primary key. This preserves PostgreSQL's extensibility but adds an extra lookup and reintroduces stale index entries and a VACUUM cleanup cycle.

In conclusion, OrioleDB's use of MVCC and its unique approach to preserving historical data within the B-tree structure provides an interesting perspective on database management systems.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Fixing Low USB-C Audio on Fedora Linux: My Battle with the Razer Leviathan

TL;DR: If you have a Razer Leviathan connected via USB-C on Linux and the volume is incredibly quiet even at 100%, PipeWire is likely crushing your ALSA hardware baseline on boot.

  • Fedora Linux user faced low audio volume on Razer Leviathan USB-C speaker
  • PipeWire session manager compressed hardware volume limits during boot
  • Bash script automatically adjusts audio settings upon login to restore full volume

Why a two-user Convex chat app read tens of MB a day

I was staring at my Convex dashboard, confused. Convex is the reactive backend I use for a chat app: it stores the data and, the part that matters here, it keeps your queries live , so the UI updates…

  • Convex app's high bandwidth due to reactive queries
  • Queries re-run on every data change, amplifying bandwidth usage
  • Solutions include pagination, optimized .collect(), stable arguments

Why a static Three.js scene still cooks your phone, and the dirty-flag fix

So I have a bunch of small games on my site. Ludo, tic-tac-toe, carrom, rock-paper-scissors. Nothing fancy, the kind of thing you'd think runs on a potato.

  • Static Three.js scenes cause phone heating due to continuous repainting in render loop.
  • Dirty flag system implemented to render scene only when necessary.
  • Ludo board renders frames only when game state changes, reducing GPU workload.

More from Sunday 16 August →