Re: FKs + partial indexes?
От | David Fetter |
---|---|
Тема | Re: FKs + partial indexes? |
Дата | |
Msg-id | 20061123180506.GA1769@fetter.org обсуждение исходный текст |
Ответ на | FKs + partial indexes? (Andrew Dunstan <andrew@dunslane.net>) |
Ответы |
Re: FKs + partial indexes?
|
Список | pgsql-hackers |
On Wed, Nov 22, 2006 at 01:33:21PM -0500, Andrew Dunstan wrote: > > I was thinking a bit about a problem that was mentioned in the > discussion TomD, Simon Rigga and I had about enums and foreign keys, > namely that often we find dozens of tiny little reference tables > littering the data model, Is this really a problem? > or else we find a table that somehow consolidates them, plus some > sort of homegrown referential integrity checks. That is the standard EAV mistake, born of fear of committing to do some things and not to do others. > I wondered if we could improve on that situation by using partial > unique indexes on the consolidated table, and providing a mechanism > to specify which index the FK must refer to (or else allow allow an > optional predicate expression which would have to match the > predicate expression of the partial index). Isn't this just putting some lipstick on the EAV pig? Cheers, D -- David Fetter <david@fetter.org> http://fetter.org/ phone: +1 415 235 3778 AIM: dfetter666 Skype: davidfetter Remember to vote!
В списке pgsql-hackers по дате отправления: