db.l3.ai

Play

lessons

what-changed-in-19

editor

engine: not started

results

Run a query to see rows here.

check

Attach

Attaching a plain table normally scans it to check every row against the bound, under a strong lock. A CHECK constraint that proves the bound lets Postgres skip that scan.

task

rp_apr is a plain table with April data. Add a CHECK matching April so the attach needs no scan under a long lock, then ATTACH it to rp.

hints