TRACKDB
2

acme-shop /prod

Supabase · Postgres 16Protected· last backup

TRUNCATE public.sessions

Heldclaude-code wants to change public.sessions on prod.Opened in session· 1 of 2 approvals on revision 2

Now proposed: revision 2, which changes 41,977 rows instead of 48,212.

Proposed change

revision-2.sqlNarrower, after Mei Lin Chen's review · claude-code
DELETE FROM public.sessions WHERE expires_at < now() - interval '30 days';
claude-code's reason
The login query is slow because public.sessions holds 48,212 rows, most of them long expired.

Dry run

on a copy of prod,
Rows affected
41,977 in public.sessions, all expired more than 30 days ago; 0 active
Cascades
None. No foreign keys point at public.sessions.
Locks
ROW EXCLUSIVE, matched rows only, about 1.8 s
Risk
Low riskNo signed-in shopper is affected.
Held by
policy.yaml:15sessions.delete: hold

If you approve: the 41,977 deleted rows go to trash first. You can restore any of them for 30 days.

Discussion 4

MC
Mei Lin Chen

Truncating also drops the 6,235 sessions that are still active. Everyone on the EU storefront would be logged out mid-checkout. Can you remove only the expired ones?

claude-codeagentProposed revision 2

You're right. I only need the expired rows to speed up the login query. Here is a narrower change:

DELETE FROM public.sessions WHERE expires_at < now() - interval '30 days';

Dry run: 41,977 rows (was 48,212), no cascades, 0 active sessions touched.

DO
Daniel OkaforApproved revision 2

Tried it on branch pr-14-preview first. Login p95 went from 840 ms to 120 ms. Approved on my side; it still needs one more approver.

PN
Priya Nair

Holding the run until EU traffic drops after 22:00 UTC. I'll approve then.