Re: [GENERAL] Optimization on UPDATEs and FOREIGN KEYs...

2004-04-02 Thread Tom Lane
Sean Chittenden <[EMAIL PROTECTED]> writes: > Does the optimizer optimize away the foreign key checks on a primary > key if its value doesn't change, even though it's had a value assigned > to it? The optimizer has nothing to do with this, but in most cases the foreign key triggers themselves wi

[GENERAL] Optimization on UPDATEs and FOREIGN KEYs...

2004-04-02 Thread Sean Chittenden
Does the optimizer optimize away the foreign key checks on a primary key if its value doesn't change, even though it's had a value assigned to it? Here's the example: CREATE TABLE t1 ( i INT PRIMARY, j TEXT ); CREATE TABLE t2 ( i INT, k INT8, FOREIGN KEY(i) REFERENCES t1(i) ); INSERT