Re: Foreign Keys Constraints, perforamance analysis - Mailing list pgsql-general

From Daniel Åkerud
Subject Re: Foreign Keys Constraints, perforamance analysis
Date
Msg-id 009001c0fd59$bf22f5f0$c901a8c0@automatic100
Whole thread Raw
In response to Foreign Keys Constraints, perforamance analysis  (Daniel Åkerud <zilch@home.se>)
Responses Re: Foreign Keys Constraints, perforamance analysis
Re: Foreign Keys Constraints, perforamance analysis
List pgsql-general
OK, I've been discussing this with a collegue of mine... and I'm starting to
see the light here...

I will, first of all, make a new, simpler, 1<->1 realtionship to test FK
constraints... no 2<->1<->2 relasionship here...

Person -> Item/item_fkc

And I will do no bulk-delete. Instead these tests:

Fill person. no time measuring.
Fill item, no foreign keys constraints, time measuring.
Fill item, foreign keys constraints
Compare last to measurments. How much do you loose in performance having the
Foreign Key check?
For all persons {
  if (fkc)
    delete from person where id = $id
  else
     delete from person where id = $id; delete from item where personid=$id
}
Compare measurements. How much do you loose having the foreign keys
constraints delete the item?

This, I think, this is a more fair comparison.

Can you call the FK itself a foreign key constraint, as it actually is
constraining something?

Thanks Stephan and Tom for the help! Greatly appreciated!!




pgsql-general by date:

Previous
From: "Eliel Mamousette"
Date:
Subject: RE: to_timestamp busted?
Next
From: Jan Wieck
Date:
Subject: Re: Foreign Keys Constraints, perforamance analysis