Skip to content

Commit

Permalink
fixup: explain use of wal_coin_balances
Browse files Browse the repository at this point in the history
  • Loading branch information
amnn committed Oct 31, 2024
1 parent 405d116 commit 77b612e
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@
-- - There is an additional index on ID and version for querying the latest
-- version of every object.
--
-- This table is used in conjunction with `sum_coin_balances` to support
-- consistent live object set queries: `sum_coin_balances` holds the state of
-- the live object set at some checkpoint `C < T` where `T` is the tip of the
-- chain, and `wal_coin_balances` stores all the updates and deletes between
-- `C` and `T`.
--
-- To reconstruct the the live object set at some snapshot checkpoint `S`
-- between `C` and `T`, a query can be constructed that starts with the set
-- from `sum_coin_balances` and adds updates in `wal_coin_balances` from
-- `cp_sequence_number <= S`.
--
-- See `up.sql` for the original `sum_coin_balances` table for documentation on
-- columns.
CREATE TABLE IF NOT EXISTS wal_coin_balances
Expand Down

0 comments on commit 77b612e

Please sign in to comment.