Re: Foreign key / performance question
| От | Vivek Khera |
|---|---|
| Тема | Re: Foreign key / performance question |
| Дата | |
| Msg-id | 9A4ED9A7-3705-42FF-A7F9-1A39410841D1@khera.org обсуждение исходный текст |
| Ответ на | Foreign key / performance question (Nico Callewaert <nico_callewaert@yahoo.com>) |
| Список | pgsql-general |
On Mar 29, 2006, at 12:35 PM, Nico Callewaert wrote: > Because from what I understand, for every foreign key, there is an > index defined. So, all these indexes has to be maintained. Is > that killing performance ? What's the best practise : defining > foreign keys or not ? If your application is 100% perfect and you never do any manual updates to the DB, then who needs FK's? Show me that your app is 100% perfect first... which there is no way you can do unless it is a trivial amount of code. But just defining FK's won't define an index. You have to do that manually else suffer performance. However, if the referenced table is only a few hundred rows or less, there is not much point in an index on that column for that table. Personally, I live by FKs since I value my data to be correct.
В списке pgsql-general по дате отправления: