Les <nagylzs@xxxxxxxxx> writes: > It seems that two foreign key constraints use 10.395 seconds out of the > total 11.24 seconds. But I don't see why it takes that much? Probably because you don't have an index on the referencing column. You can get away with that, if you don't care about the speed of deletes from the PK table ... regards, tom lane