Forum Moderators: open

Message Too Old, No Replies

one table or two - best structure?

one large text field and a bunch of small varchars

         

deejay

2:23 am on Aug 11, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's it in a nutshell. I have a mysql database of articles - 8 small fields with things like article title, authorid, published date, publication, etc.. and of course one large text field that contains the article body.

Quite simply, am I best to store the article content field in the same table as the rest of the short fields, or in a table of its own with article id linking the two? Does it make a difference performance wise?

sgietz

9:33 pm on Aug 14, 2008 (gmt 0)

10+ Year Member



I have a similar set up and put the body in the same table. It's not causing any problems.

ZydoSEO

6:08 pm on Aug 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would also recommend the single table approach since the body is an attribute of EVERY article. It would be hard to have an article with no body.

You really don't buy yourself anything by splitting the body out into its own table UNLESS it were an attribute that only exists for a small percentage of articles.

deejay

4:17 am on Aug 18, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Excellent, thanks for the responses. I was leaning towards body in the main table if only for the convenience of writing simpler queries, and of course ZydoSEO is right - it is a 1:1 relationship.