[TYPO3-dev] table joins and TCA

Stig N. Færch stig at 8620.dk
Tue Mar 14 22:38:57 CET 2006


"Martin Kutschker" <Martin.Kutschker at n0spam-blackbox.net> skrev i en 
meddelelse news:mailman.1.1142326345.24455.typo3-dev at lists.netfielders.de...
> Stig N. Færch schrieb:
>>>>Wouldn't this be the suggested way to do it from a database viewpoint?
>>>
>>>The problem with such a DB layout is that you cannot get details for all
>>>types with on select nicely. You can get easily the main data with a
>>>select on the main table. You can get main data and details for one type
>>>with s join. But you would have to do a giant outer join select if you
>>>need the details for all types.
>>
>>
>> So what you are saying is, that when we join more than one table to the 
>> main
>> table, we get into problems?
>
> Do you like a stetement like this?
>
> SELECT main.*, detail1.foo, detail2.bar, [etc]
>  FROM main
>   LEFT OUTER JOIN detail1 USING uid
>   LEFT OUTER JOIN detail2 USING uid
>   LEFT OUTER JOIN detail3 USING uid
>   LEFT OUTER JOIN detail4 USING uid
>   LEFT OUTER JOIN detail5 USING uid
>
> This is what you'll need to get all details for all types in one select.

No it doesn't look very nice, - but this is also a worst case scenario I 
guess.
Many extensions would probably be fine with extending the main table with a 
field or two,
and only the bigger extending extensions will have to have its own table.

Put of course I see your point :-)

/Stig 






More information about the TYPO3-dev mailing list