Re: [GENERAL] Adding domain type with CHECK constraints slow on large table

2007-09-20 Thread Tom Lane
Jerry Sievers [EMAIL PROTECTED] writes: I believe what's happening here is that the server doesn't realize that the new column is going to have all nulls and that the check constraint allows nulls. As such, the check evidently is being evaluated for each row of the table. Yup, that's right.

Re: [GENERAL] Adding domain type with CHECK constraints slow on large table

2007-09-20 Thread Jerry Sievers
Tom Lane [EMAIL PROTECTED] writes: Jerry Sievers [EMAIL PROTECTED] writes: I believe what's happening here is that the server doesn't realize that the new column is going to have all nulls and that the check constraint allows nulls. As such, the check evidently is being evaluated for