--- Tedit kap <[EMAIL PROTECTED]> wrote:

> As far as table size considerations and storage efficiency I have the
> following question:
>  
> I would like to store articles in mysql table. 
>  
> I will display only the title on one page. 
> only title and first two sentences in two more pages. 
> the whole article i will display in one page only if the user cliks to see
> all....
>  
> based on this:
>  
> 1) apart from title and first two sentences, should i store the rest of the
> whole article (which is a lot more text) in the same table, or in another
> table or in another file or how? of course i prefer to store the whole
> article in one row of one table. but i am wondering if that way is efficient?
>  
> 2) when storing sentences or paragraphs of the article, should i just assign
> TEXT variable to those columns? it looks like the easiest way, but as far as
> table size, is it efficient? for example limiting a columnsize with varchar()
> or something like that is it more efficient? or is there a trim function or
> something like that to help storing efficiency?
> 
> 3)displaying articles with php: would that make a difference or not based on
> what i chose?
>  
> Thanks

The datatype called 'text' is about as efficient as varchar.  The number of
bytes required to store the content is the length plus just one byte for
varchar and two bytes for text.  The maximum length of a text is 64k.

Storing "James" in a varchar(10) is the same as varchar(255).

You may decide to store the teaser separately or include a non-printing marker
to separate the teaser from the rest of the article.  Your program that
retrieves the content can parse the text to get the teaser from the entire
story.  It probably won't take much space to store the teaser separately if you
find it easier.

James

Reply via email to