Monday, 19 March 2012

Q: How many engines in mysql ?


mysql> SHOW ENGINES;
nnoDB   
MRG_MYISAM
BLACKHOLE 
CSV       
MEMORY
FEDERATED
ARCHIVE  
MyISAM 
When to use MyISAM?
MyISAM is designed with the idea that your database is queried far more than its updated and as a result it performs very fast read operations. If your read to write(insert|update) ratio is less than 15% its better to use MyISAM.
MyISAM limitations
  • No Foriegn keys and cascading deletes and updates
  • No rollback abilities
  • No transactional integrity (ACID compliance)
  • Row limit of 4,284,867,296 rows
  • Maximum of 64 indexes per row
·         When to use InnoDB?
·         InnoDB uses row level locking, has commit, rollback, and crash-recovery capabilities to protect user data. It supports transaction and fault tolerance
InnoDB Limitations
  • No full text indexing
  • Cannot be compressed for fast, read-only
Convert from one type of engine to other.
CREATE TABLE table_name (rid INT) ENGINE = INNODB;
CREATE TABLE table_name (rid INT) TYPE = INNODB

No comments:

Post a Comment