InnoDB

InnoDB相关

[MySQL FAQ]系列 -- 为何innodb表select count(*)很慢

innodb表不像myisam,有个内置的计数器。
1. 可以用

select count(*) from table_name where primary_key >=0

2. 或

select count(*) from table_name where key_col >=0

3. 类似这样的来查询,通过

show table status

得到的结果不够准确,会随时变化,只是个大致的值

如果该表的列数较多,那么建议用第二种方法。

技术相关:

[InnoDB系列] -- SHOW INNODB STATUS 探秘

原文译自:http://www.mysqlperformanceblog.com/2006/07/17/show-innodb-status-walk-through/

 

很多人让我来阐述一下 SHOW INNODB STATUS 的输出信息, 了解 SHOW INNODB STATUS 都输出了些什么信息,并且我们能从这些信息中获取什么资讯,得以提高 MySQL 性能。

首先,让我们来了解一下 SHOW INNODB STATUS 输出的基础,它打印了很多关于 InnoDB 内部性能相关的计数器、统计、事务处理信息等。在 MySQL 5 中,InnoDB 的性能统计结果也在 SHOW STATUS 结果中显示了。大部分和 SHOW INNODB STATUS 的其他信息相同,在旧版本中还没有这个功能。

SHOW INNODB STATUS 中的很多统计值都是每秒更新一次的,如果你打算利用这些统计值的话,那么最好统计一段时间内的结果。InnoDB 首先输出以下信息:

MySQL 5.1.24rc + innodb plugin尝鲜

1. 前言

oracle 收购 innobase 后,沉寂了将近2年,innodb开发团队一直是在修改bug等,也没见到什么动作。
前几天,他们终于宣布,发布最新的innodb plugin for MySQL 5.1,这个plugin其实等同于innodb引擎,只是可以plugin的方式安装,也可以自己编译。

innodb plugin 的一些主要新特性有:

  • Fast index creation: add or drop indexes without copying the data
  • Data compression: shrink tables, to significantly reduce storage and i/o
  • New row format: fully off-page storage of long BLOB, TEXT, and VARCHAR columns
  • File format management: protects upward and downward compatibility
  • INFORMATION_SCHEMA tables: information about compression and locking
    • Other changes for flexibility, ease of use and reliability
  • Dynamic control of innodb_file_per_table
  • TRUNCATE TABLE re-creates the *.ibd file to reclaim space
  • “Strict mode” to prevent mistakes

[InnoDB系列] - InnoDB独立/共享表空间的转换

前言:设置启动选项 innodb_file_per_table 即可启用独立表空间。不过,InnoDB总是需要共享标空间,.ibd文件对InnoDB不足以去运行,共享表空间包含熟悉的ibdata文件,InnoDB把内部数据词典和撤销日志(undo log)放在这个文件中。

测试环境:Windows XP, MySQL 6.0.0-alpha-community-nt-debug

1. 在不设定 innodb_file_per_table 的情况下(即使用共享表空间),创建一个表。
2. 关闭MySQL
3. 启用 innodb_file_per_table
4. 执行 OPTIMIZE TABLE 或者 ALTER TABLE 等空(NULL)操作

反之也一样

[InnoDB系列] - InnoDB释放表空间

前言:设置启动选项 innodb_file_per_table 即可启用独立表空间。不过,InnoDB总是需要共享标空间,.ibd文件对InnoDB不足以去运行,共享表空间包含熟悉的ibdata文件,InnoDB把内部数据词典和未作日志放在这个文件中。

测试环境:Windows XP, MySQL 6.0.0-alpha-community-nt-debug

先来查看一下该表的状态:

mysql> SHOW TABLE STATUS LIKE 'yejr'\G
*************************** 1. row ***************************
           Name: yejr
         Engine: InnoDB
        Version: 10
     Row_format: Compact
           Rows: 162049
 Avg_row_length: 80
    Data_length: 13123584
Max_data_length: 0

InnoDB Performance Optimization

原文来自: http://mysqldatabaseadministration.blogspot.com/2007/04/innodb-performan...

I am sitting in the session "InnoDB Performance Optimization" by Heikki Tuuri and Peter Zaitsev. This is going to be the last session of a very enjoyable and informative MySQL Conference and Expo 2007.

General Application Design is Paramount
Of course, you should design your schema, indexes and queries right. Storage engines aspects are often fine tuning. Storage engine selection may affect your schema layout and indexes.

Each storage engine has unique design and operating properties. App written for 1 storage engine may not perform best with other storage engines. Special optimizations exist for each storage engine.

页面

Subscribe to RSS - InnoDB