Posted by shyamala on August 9, 2008 at 4:31pm
How do you convert a MyIsam table to Innodb tables in Drupal? Though we have carried out the configuration changes, the changes have not taken effect.
Shyamala
How do you convert a MyIsam table to Innodb tables in Drupal? Though we have carried out the configuration changes, the changes have not taken effect.
Shyamala
Comments
ALTER TABLE tablename ENGINE = InnoDB;
You have to issue ALTER TABLE for those tables that you wish to convert from one engine to another. It would look somthing like this:
ALTER TABLE tablename ENGINE = InnoDB;Just make sure you have working backups, just in case, and properly dimensioned InnoDB tablespaces.
InnoDB isn't always better than MyIsam
You should choose InnoDB over MyIsam for a table in two situations only:
Also innodb is a bit slower on Select and massively slower on count
Don't forget
Here is a very good note from "Pro Drupal Development" book, CHAPTER 22 - OPTIMIZING DRUPAL, p.347:
Note Since Drupal still uses the LOCK TABLE command with InnoDB tables, be sure to disable autocommit mode within MySQL, or MySQL and InnoDB will both take on table locks.
See http://dev.mysql.com/doc/refman/5.1/en/lock-tables.html for more information.
Good Luck,
Alex Pandre
Custom Drupal modules and themes development, Optimization, Version Control.
Join MySQL group and post your suggestions in related groups in the same time.
Alex Pandre
Custom Drupal modules and themes development, Optimization, Version Control.
Join MySQL group and post your suggestions in related groups in the same time.
I read this : Since Drupal
I read this : Since Drupal still uses the LOCK TABLE command with InnoDB tables, be sure to disable autocommit mode within MySQL, or MySQL and InnoDB will both take on table locks.
but still figuring our how to fix it?? How do we release the lock or disable autocommit mode?? is it just a mysql setting?
Netlink Technologies Ltd
http://shyamala-drupal.blogspot.com/
Shyamala
Unimity Solutions
http://www.oreillynet.com/dat
I know it's kinda late, but for future users ...
http://www.oreillynet.com/databases/blog/2007/02/mysql_transactions_and_...
(go to the section on disabling autocommit)
It involves editing your my.cnf file and including this bit of code:
[mysqld]
init_connect='SET autocommit=0'
...
init_connect does some really bad things with sites - can't login, can add nodes, etc. I'm sure there is some way to use this setting sensibly but I haven't been able to find anything that addresses the shortcoming/problems. Fyi
UPDATE: Looking at this page, sounds like the way to control autocommit, at least in Drupal, is on a per query basis rather than globally within my.cnf.
Yeah, you're right. For some
Yeah, you're right. For some reason, it ended up causing a bunch of problems with my site. I'll try out the solution you mentioned.
better to apply the no-lock patch
so core won't lock tables:
drupal.org/node/55516
and you'll also want to leave node_revisions as myisam (has a fulltext index on it which is not supported by innodb) and search_index (which gets lots of select *) as myisam.
cheers,
-o
Drupal 7 is gonna have InnoDB
Drupal 7 is gonna have InnoDB as default table engine!
force queries to retry X times
BTW: Here's a patch to force queries to retry X times if they fail due to table deadlocks, etc.
http://drupal.org/node/476048
Looks like patches for both D6 and D7.