freelance84 Posted February 17, 2011 Share Posted February 17, 2011 I recently came across this link: http://www.softwareprojects.com/resources/programming/t-never-use-varchar-in-mysql-1916.html The person who wrote it states it is best to never use VARCHAR and use either CHAR or TEXT, claiming the space saved is negligible compared to the problems it can cause. There has only been one post to his claims but wondered if any one else had any comments on it... (i use varchar a lot due to the book i learnt from) Quote Link to comment https://forums.phpfreaks.com/topic/227989-never-use-varchar/ Share on other sites More sharing options...
Pikachu2000 Posted February 17, 2011 Share Posted February 17, 2011 I doubt I would base my decision to stop using VARCHAR fields based on one blog entry, especially since it presents no hard evidence at all. Quote Link to comment https://forums.phpfreaks.com/topic/227989-never-use-varchar/#findComment-1175650 Share on other sites More sharing options...
freelance84 Posted February 17, 2011 Author Share Posted February 17, 2011 Yea i thought as much, but thought i would just see if anybody else had come accros this Quote Link to comment https://forums.phpfreaks.com/topic/227989-never-use-varchar/#findComment-1175702 Share on other sites More sharing options...
fenway Posted February 17, 2011 Share Posted February 17, 2011 Yeah, that's nonsense. The mismatch issue is just poor DBA management -- that will happen with CHAR, too. The conversion at lower length doesn't matter. And MySQL 5 support VARCHAR up to 65k, so there's no need to get into TEXT/BLOB hell for >255 anymore. Yes, if most of your data is taking up most of the VARCHAR space, then you don't get any benefit from the variable length aspect, and don't bother. But in the real-world, it's impossible to know. Also -- and the blog neglected to mention this -- if you have even one variable-length field in your table, you won't get any benefit from the fixed-width ones. In fact, I'm fairly certain that they get converted to VARCHAR without even asking you. Quote Link to comment https://forums.phpfreaks.com/topic/227989-never-use-varchar/#findComment-1175783 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.