Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


boostr.in questions - Question:MySQL 5.5 : Which one of the following is a better storage for a text/varchar field in innodb?


Requirement :

    Page#1 -> Display users and 1-2 line preview of their blogpost

    Page#2 -> Display single user and full blogpost

Method 1 :

MySQL table ->   userid -> varchar 50
                 post_id -> integer
                 post_title -> varchar 100
                 post_description -> varchar 10000

for page#1 , select user_id, post_title , post_description from blog_table . and substring of post_description is used to show preview in the listing.

for page#2 , select user_id , post_title, post_description where post_id = N
Method 2 :

 MySQL table ->   userid -> varchar 50
                  post_id -> integer
                  post_title -> varchar 100
                  post_brief -> varchar 250
                  post_description -> text

for page#1 , select user_id, post_title , post_brief from blog_table .

for page#2 , select user_id , post_title, post_description where post_id = N

Does storing two columns, one brief as varchar and one full as text ( since it accesses the file system , and should be queried only when needed ) , worth the performance benefit ?

asked Sep 13, 2013 in MYSQL by rajesh
edited Sep 12, 2013
0 votes
15 views



Related Hot Questions



Walkin Jobs Opening



Government Jobs Opening


...