[TYPO3-core] RFC: Bidirectioanl MM relations

Franz Holzinger franz at fholzinger.com
Fri Sep 8 17:25:42 CEST 2006


Hello Ingmar,

> Franz Holzinger wrote:
> > Hello Kasper,
> > 
> > it would be possible to integrate a 'pid' into mm tables as well.
> > However it would not make sense to introduce a 'uid' into a mm table. So
> > we need some flexibility instead of a new column 'uid' for a mm table.
> 
> You can simply give it a uid column as well, there's no problem with it.
> 
no, there could occur problems with that.

Usually mm tables get created and deleted frequently. If you assign a
new relation you have a record with 'uid_local' and 'uid_foreign'. But
when you have an additional 'uid' which is the key, then this 'uid' will
always get incremented. 
Then you delete the relation and the record gets deleted. Then you
recreate it with the same 'uid_local' and 'uid_foreign', but the uid
will be different from before. This means that you can never rely on the
'uid' if you want to form MYSQL queries. But then the uid is a useless
key. And this would be against the rules of database normalization. We
would have 2 keys: uid and (uid_local, uid_foreign). This would decrease
the performance unnecessarily.

Greets,

Franz












More information about the TYPO3-team-core mailing list