One JSON input forks into json text retaining duplicate a keys and a jsonb object with only a=3; both can extract fields.

Postgres jsonb stores JSON for querying

PostgreSQL offers two JSON storage types with different representation costs. json validates and retains the input text, while jsonb converts it into a decomposed binary value. Both support extracting fields and paths. Choosing between them is primarily a decision about preserving representation, processing documents repeatedly, and supporting the operators your queries need. ...

December 4, 2027 · 5 min · XB Field Notes
Two retained lease slots fill a finite pool and stop a third checkout; a return path restores a slot without enlarging the pool.

A leaked connection drains the pool

A pool leak is an ownership failure: application work finishes, but its borrowed connection remains checked out. The database may still answer other clients normally while this application has no leases left. Treat release as part of the operation’s contract, including exceptions and early returns, rather than a cleanup courtesy after success. ...

November 5, 2027 · 5 min · XB Field Notes
Three model runs feed complete-history compaction: a newer b deletion masks b old; with no retained snapshots, the output contains the newer a and c. Values 1,2,3 abbreviate one,two,three.

LSM trees trade foreground writes for later merging

An LSM tree moves work from scattered updates toward buffered writes and later merging. That is a design trade, not a promise that every disk operation becomes sequential or that random writes always beat a B-tree. The useful question is whether foreground writes, background compaction, reads, and retained versions fit the same resource budget. ...

November 2, 2027 · 5 min · XB Field Notes
A reader snapshot at 10 pins the transfer from committed WAL value 20 into the database file.

Checkpoints establish a recovery starting point

A checkpoint records progress that lets a database recover without treating its entire log history as outstanding work. The exact operation depends on the engine. PostgreSQL synchronizes the data changes required for a checkpoint and establishes a redo starting point. SQLite in WAL mode transfers eligible committed page frames from its WAL into the main database file. Neither operation is simply another name for transaction commit. ...

October 17, 2027 · 5 min · XB Field Notes
A value arrow enters a percent-s placeholder in SQL. A separate purple loop marks optional reuse; zero named statements can still retain binding. Source fixture, not rerun.

Prepared statements separate values from SQL structure

Parameter binding gives a database value a designated position in a SQL statement. A name containing a quote or a semicolon remains a value instead of becoming another clause. Reusing a named prepared statement adds a separate optimization: the server can retain statement information across executions in one session. Safe binding does not require the application to create a named statement for every query. ...

October 16, 2027 · 5 min · XB Field Notes
Three history dots face one active seat slot; a red barrier blocks a reactivation arrow from entering the occupied slot.

Partial uniqueness protects the active subset

A partial index stores entries only for rows satisfying its predicate. This can reduce index size when the useful subset is small, but it can also enforce a rule that applies only to that subset. For example, a seat may have many historical reservations while allowing at most one active reservation. A partial unique index expresses that rule at the database boundary. ...

October 15, 2027 · 5 min · XB Field Notes
A B-tree entry uses sku 4321 as the search key and stores price 43215 as payload. The heap page’s all-visible bit gates returning the indexed price or visiting the heap. An Index Only Scan can still access the heap.

Covering indexes can avoid heap visits

A covering index contains the values needed by a particular query. PostgreSQL can sometimes return those values through an index-only scan, avoiding heap visits for qualifying rows. The word “sometimes” matters: having the columns is a structural requirement, while visibility information determines whether execution can actually skip the heap. An Index Only Scan label alone does not prove zero table access. ...

October 14, 2027 · 4 min · XB Field Notes
For a=7 and b=7, actual output is 100 rows. Independence predicts one row, while collected dependency statistics predict 100. For a=7 and b=8, the dependency still predicts 100 while actual output is zero.

Query planners bet on cost, not certainty

A query planner chooses an execution path using estimated work. It does not run every candidate, time them, and keep the winner. PostgreSQL compares possible scans, joins, sorts, and other operations using statistics and a cost model. The chosen plan is therefore a prediction under current assumptions. Understanding a wrong prediction requires identifying which assumption failed, rather than treating a sequential scan or a nested loop as inherently suspicious. ...

September 17, 2027 · 4 min · XB Field Notes