Passing tests doesn’t mean a change is safe for production

Check every database change against real production workload. Agents see which queries it breaks, slows or locks before it ships.

Coding agentBaseshift cloneChange impactanalysisstart clone #1connectrun migration v1queries it ran2 statements affectedstart clone #2run migration v2queries it rannone affectedv1 slows a hot write path · rejectedv2 affects nothing in production · ready
1/4The agent runs migration v1 on a fresh Baseshift clone.Change impact analysis flags 2 affected statements. v1 is rejected.The agent revises the change and runs v2 on a new clone.No production statements affected. v2 is ready to merge.

See what every change touches

See which production queries a change affects, and why

Breaking changes

Dropping or retyping a column lists every statement that names it, including SELECT *.

Locking and downtime

A lock held long enough to matter lists the statements that would queue behind it: reads and writes, or writes only.

Index regressions

Dropping an index lists the statements whose plan actually uses it.

Write amplification

A new index lists the frequent writes that will lose cheap in-place updates, and the reads it serves.

Unexpected overhead

A new trigger or function lists the inserts and updates that already write the columns its body reads.

Table copies

Copying a table lists the statements that write it and the ones that sum or count it.

How it works

Production context.

Before every merge.
1

Sample production

Connect Baseshift to your production primary. It samples the queries running there: what runs, how often, and how long it takes.

postgres://•••@prod-primary sampling
2

Test the change on a clone

The agent applies its migration on a Baseshift clone and runs its tests, as it already does.

CREATE INDEX CONCURRENTLY ix_inventory_dead_stock … ✓ tests passed
3

Get scoped context back

Baseshift matches the queries the change ran against the production workload and returns the affected statements, why each one matched, and what it costs.

2 production statements affected · 500 calls context returned
4

Revise, or ship with confidence

The agent revises the change until nothing in production is at risk, or you require approval or schedule the merge when the impact is high.

v2 · 0 statements affected ✓ ready to merge

What your agent gets back

Not a risk score. Structured evidence from your real workload, the same numbers you’d pull from pg_stat_statements and pg_stats yourself, scoped to the change under review.

Affected statements

Normalized SQL, call count and total time for every production statement the change touches, each with the reason it matched.

readers_common
readers_slow
because

Locking

The lock the change takes, what it blocks, and whether it’s held long. If it is, the statements that would queue behind it.

lock
blocks
long_lock

Write cost

How many of the table’s updates are in-place (HOT) today, and for each affected write: calls, WAL bytes and records, blocks dirtied.

hot_share
writes[]

Table and column stats

Row count, plus null fraction and distinct values for the columns the change names, so the agent can tell whether a filter will actually narrow anything.

rows
null_frac
n_distinct

Index fit

The new index’s keys and predicate, the indexes already on the table, and whether it matches the ORDER BY and LIMIT the query needs.

indexes
index_matches_order
serve

Query windows

Date ranges baked into reports and functions: the window, its default as-of date and the cutoff it produces.

read_window

Query plans

A summary of the plan for each affected statement, before the change and after it: scan type, index used, rows and buffers. When there’s no plan on one side, a note says why, so the agent can see when an index it relies on would disappear.

"source_plan": {
"scan": "Index Scan",
"index": "ix_customers_regime_status",
"rows": 12,
"buffers": null
},
"after_plan": null,
"after_note": "after_plan_does_not_exist"
source_plan
after_plan
after_note
judge_clone_rolloutResponse for the example below, trimmed
{
"kinds": ["index"],
"migration": [{
"sql": "CREATE INDEX CONCURRENTLY ix_inventory_dead_stock …",
"lock": "share_update_exclusive",
"blocks": "none",
"long_lock": false,
"indexes_on_relation": 1,
"index_matches_order": false,
"hot_share": { "updates": 1000, "hot_updates": 800, "share": 0.8 },
"column_stats": {
"rows": 520000000,
"columns": {
"on_hand": { "null_frac": 0, "n_distinct": 45 },
"last_movement_at": { "null_frac": 1, "n_distinct": 0 }
}
},
"writes": [{
"sql": "UPDATE public.inventory SET on_hand = …, last_movement_at = …",
"calls": 500, "wal_bytes": 1000, "wal_records": 40, "shared_blks_dirtied": 8
}],
"read_window": { "column": "last_movement_at", "days": 365, "cutoff": "2015-10-01" },
"serve": { "order_by": [{ "column": "on_hand", "dir": "DESC" }], "limit": { "default": 100 } }
}],
"lookups": [{
"migration_index": 0, "source": "predicate", "sql": "on_hand > 0",
"plan": null, "note": "not_planned"
}],
"detail": {
"readers_total": 2,
"readers_common": [
{ "sql": "UPDATE public.inventory SET on_hand = …", "calls": 500,
"because": "sets last_movement_at, on_hand; a new index on these columns stops heap-only updates" },
{ "sql": "SELECT i.shop_id, i.on_hand … WHERE i.on_hand > 0 AND …", "calls": 3,
"because": "reads last_movement_at, on_hand; this index is for these columns" }
],
"readers_slow": [ … ]
}
}