• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

My Monkey Do

A Log of Coding Solutions

  • Home
  • Web Hosts
  • Tools
  • About

mysql

VARCHAR vs TEXT Performance

May 21, 2011 by Webhead

Ever wonder if VARCHAR(255) or TEXT is a better data type?  This thread suggests VARCHAR(255) is better because it is allowed to use MEMORY (or RAM).  The TEXT data type is not allowed in there.

http://forums.mysql.com/read.php?24,105964,105964#msg-105964

 

Although it was also found that a larger VARCHAR like VARCHAR(3000) has worse performance than TEXT (in MyISAM).

http://nicj.net/2011/01/20/mysql-text-vs-varchar-performance

 

The general rule appears to be to use VARCHAR if it is less than 255 characters and to use TEXT if it’s 255 or more.

Filed Under: Coding Tagged With: mysql, optimize

Optimize MySQL using EXPLAIN

May 20, 2011 by Webhead

If you need to optimize or find out how a MySQL query is doing, type in “EXPLAIN” before the query and you’ll get a table that shows a bunch of statistics.  I’m not going to try to explain them all.  It can be found on the MySQL docs site:

http://dev.mysql.com/doc/refman/5.0/en/explain-output.html

Filed Under: Coding Tagged With: mysql

  • « Go to Previous Page
  • Go to page 1
  • Go to page 2
  • Go to page 3

Primary Sidebar

Topics

502 apache apple bluehost bootstrap buddypress chrome cloudways cms css debug drupal eCommerce firebug firefox git goDaddy google google analytics google maps hacked hosting htaccess html html 5 icons IE crap image iPad iPhone javascript jquery linux localization mac os x ms sql mysql open source optimize php tinymce wordpress wpengine yii youtube




Categories

  • Coding
  • Off the Shelf
  • Plugins
  • Random Thoughts
  • Server Stuff
  • Tools