6. Таблица сравнения MyISAM InnoDB Нет транзакций Есть транзакции 1 SQL запрос иногда не атомарен SQL всегда атомарен “STRICT” mode не работоспособен “STRICT” mode работает плохо Не crash safe Crash safe
7. Таблица сравнения (2) MyISAM InnoDB Дедлоки невозможны* Код приложения д.б. готов к дедлокам Каждая табличка: 3 файла: .frm, .myd, .myi A table is stored in a tablespace; 1 tablespace = many files; uncommitted transactions are stored in the log file; + .frm by MySQL
8. Таблица сравнения (3) MyISAM InnoDB SELECT COUNT(*) is instant SELECT COUNT(*) не быстр :) Нет data cache. Только key cache. Page cache кэширует всё. Несколько key caches. ASSIGN TO KEY CACHE, PRELOAD KEYS Single cache; SELECT * FROM … for warm-up Key cache burst writes Insert buffer
9. Таблица сравнения (4) MyISAM InnoDB Данные хранятся в порядке вставки В порядке первичного ключа Есть compressed format. Нормальный compressed format. R-tree, B-tree, Fulltext index B+-tree, adaptive hashing No background threads Background write-back threads monitor: overflow, checkpoint, commit
10.
11. Итог MySQL #support channel (internal IRC), 29-09-2009 ----------------------------------------------------------------------- 22:34 < kostja> do we have widely known customers/community users who use myisam? 22:34 < kostja> like, I know that youtube and wikipedia use innodb; 22:34 < kostja> who does use myisam nowadays? 22:35 < MLord> kostja: not any that I can think of 22:35 < MLord> kostja: most people realize it's generally a bad idea sooner or later 22:35 < kostja> so most people sit in mixed environments at least? 22:35 < MLord> kostja: yeah, most people have at least a few MyISAM tables 22:35 < kostja> MLord: right... 22:36 < James> kostja, mysql. database and temporary tables covers it for most professional installations. Good crash recovery matters and MyISAM doesn't qualify. 22:36 < hartmut> kostja: if it weren't for FULLTEXT and the few GIS users out there it would probably be ready to die 22:38 < MLord> kostja: it's mostly OEMs that still use MyISAM 22:39 < MLord> kostja: partly because it's half the price and partly because that's what they originally used and it takes a long time to make changes 22:37 < kostja> thanks -----------------------------------------------------------------------