4 ms·
If adding this check to an existing table with millions of records, will it scan the entire table checking all of the records, or just check when the records ar
by warmwaffles 4y ago
If adding this check to an existing table with millions of records, will it scan the entire table checking all of the records, or just check when the records are inserted or updated.
- oliverrice 4y agoif you add a check constraint to an existing table only new/updated records are checked. Existing records will not be checked
- mjw1007 4y agoWhat you describe is not the default behaviour with PostgreSQL (though it is available, via ALTER TABLE ADD CONSTRAINT ... NOT VALID).