[support] CCK fields being created as separate tables in the db

Gordon Heydon gordon at heydon.com.au
Fri Mar 21 10:14:34 UTC 2008


Hi,

Yes this is correct, and there have been some people that will tell you 
to use multiple and shared fields as little as possible as it is a 
performance impact.

I have recently discovered that this is not true. All fields not matter 
what the type all have basically the same performance impact.

The basic rule with CCK is to keep the total numbers of fields per node 
as few as possible.

I have fixed this in Drupal 5, and just need to clean up the patch 
before I submit it.

Gordon.

Neil: esl-lounge.com wrote:
> OK, I found the answer in the second half of this article on the db 
> aspects of CCK:
>  
> http://www.lullabot.com/articles/an_introduction_to_the_content_construction_kit
>  
> the two fields (which were actually hobbies and favourite music genres 
> now I recall...) both accepted multiple values so it seems that is the 
> crucial factor in deciding whether a CCK field gets added to the db as a 
> separate table or part of a content type table: that - and whether the 
> field is shared between content types.
>  
> Neil
> 
>     ----- Original Message -----
>     *From:* Neil: esl-lounge.com <mailto:neil at esl-lounge.com>
>     *To:* support at drupal.org <mailto:support at drupal.org>
>     *Sent:* Friday, March 21, 2008 10:16 AM
>     *Subject:* [support] CCK fields being created as separate tables in
>     the db
> 
>     I've been pulling my hair out about this for two hours. I have made
>     a nodeprofile content type and am using cck fields to build it.
> 
>     All the fields I created were added as columns to the
>     content_type_nodeprofile table....except the last two which were
>     added to my db as separate tables:
> 
>     content_field_hobbies
>     content_field_age
> 
>     these were the last two I added and, also, I had a few problems with
>     the "group" they sat in, so I ended up changing the name and
>     deleting and recreating the groups at least once...may this have
>     caused the issue?
> 
>     I've tried totally deleting the relevant fields and groups and
>     starting again, but they keep getting created as separate tables. Aagh!!
> 
>     Basically, what is it that makes CCK create a field as a separate
>     table instead of putting it as a column inside the content type table?
> 
>     Neil
> 
>     ------------------------------------------------------------------------
> 
>     -- 
>     [ Drupal support list | http://lists.drupal.org/ ]
> 
> !DSPAM:1000,47e3814722643366512726!
> 


More information about the support mailing list