Re: FOREIGN KEYS vs PERFORMANCE

From: "Craig A(dot) James" <cjames(at)modgraph-usa(dot)com>
To: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
Cc: PFC <lists(at)peufeu(dot)com>, Michael Glaesemann <grzm(at)myrealbox(dot)com>, Rodrigo Sakai <rodrigo(dot)sakai(at)zanthus(dot)com(dot)br>, pgsql-performance(at)postgresql(dot)org
Subject: Re: FOREIGN KEYS vs PERFORMANCE
Date: 2006-04-12 17:36:28
Message-ID: 443D3A9C.40106@modgraph-usa.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Jim C. Nasby wrote:
>>1. You have only one application that modifies the data. (Otherwise, you
>>have to duplicate the rules across many applications, leading to a
>>code-maintenance nightmare).
>
> You forgot something:
>
> 1a: You know that there will never, ever, ever, ever, be any other
> application that wants to talk to the database.
>
> I know tons of people that get burned because they go with something
> that's "good enough for now", and then regret that decision for years to
> come.

No, I don't agree with this. Too many people waste time designing for "what if..." scenarios that never happen. You don't want to be dumb and design something that locks out a foreseeable and likely future need, but referential integrity doesn't meet this criterion. There's nothing to keep you from changing from app-managed to database-managed referential integrity if your needs change.

Design for your current requirements.

Let us be of good cheer, remembering that the misfortunes hardest to bear are
those which never happen. - James Russell Lowell (1819-1891)

Therefore do not be anxious about tomorrow, for tomorrow will be anxious for
itself. Let the day's own trouble be sufficient for the day.
- Matthew 6:34

Craig

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Bruce Momjian 2006-04-12 19:56:17 Re: bad performance on Solaris 10
Previous Message Jim C. Nasby 2006-04-12 15:39:51 Re: FOREIGN KEYS vs PERFORMANCE