InnoDB

InnoDB相关

[深入理解MySQL系列] - mysqldump的几个主要选项探究

0、前言

本文主要探讨 mysqldump 的几种主要工作方式,并且比较一下和 mk-parralel-dump 的一些差异,为备份方式的选择提供更多的帮助。

 

1、mysqldump

首先来看下 mysqldump 的几个主要参数的实际工作方式。

mysqldump 几个主要选项
1. -q
很简单,什么都不做,只是导出时加了一个 SQL_NO_CACHE 来确保不会读取缓存里的数据。

[InnoDB系列] - InnoDB Buffer Pool保存和还原补丁

参考文章:Making MySQL more usable: InnoDB save/restore buffer pool patch
Jeremy Cole同学写了个补丁,用于将InnoDB 缓冲池(buffer pool)里的列表在关闭mysqld时保存到本地文件中,重启启动时再加载到内存中去。该补丁目前只适用于MySQL 5.1版本。作者计划该补丁至少应具备以下几点要求:

  • 可以自定义本地文件名
  • 可以在启动时自主选择是否需要加载到内存中
  • 支持在接受用户请求前先加载一部分,剩下的可以放到后台进程中继续加载

MySQL 微秒慢查询补丁

原文出自:The new cool MySQL patch has landed! Check your queries performance!,本文做只部分翻译。

MySQL微秒慢查询(microtime slow query)补丁包具有以下特色:

  • 识别连接

  • 每个慢查询结果中都记录了是哪个连接线程引起的,如下:

# Thread_id: 571

[深入理解MySQL系列] - sort_buffer

注:本系列文章主要探讨 MySQL 内存利用以及执行计划相关的一些知识点,从而为 MySQL 优化打下更好的基础。

环境说明

OS: AS4U6, 2.6.9-67.0.15.ELsmp, 16G Ram, MD3000阵列, xfs文件系统
MySQL 5.1.26 - percona(innodb plugin, innodb stat, user stat, msl, show patch, acc-pslist 补丁)

[InnoDB系列] - InnoDB VS PBXT实测

1、前言

PBXTPrimeBase 公司推出的MySQL插件引擎,其功能和 InnoDB 类似,主要特性如下:

  • MVCC Support:
    MVCC stands for Multi-version Concurrency Control. MVCC allows reading the database without locking.
  • Fully ACID complient:
    This means that transactionally safe, and able to handle multiple concurrent transactions.
  • Row-level locking:
    When updating, PBXT uses row-level locking. Row-level locking is also used during SELECT FOR UPDATE.
  • Fast Rollback and Recovery:
    PBXT
    uses a specialized method to identify garbage which makes "undo"
    unncessary. This make both rollback of transactions and recovery after
    restart very fast.
  • Deadlock Detection:
    PBXT identifies all kinds of deadlocks immediately.
  • Write-once:
    PBXT
    uses a log-based storage which makes it possible to write transactional
    data directly to the database, without first being writen to the
    transaction log.
  • Referential Integrity:
    PBXT supports foreign key definitions, including cascaded updates and deletes.
  • BLOB streaming:
    In combination with the BLOB Streaming engine PBXT can stream binary and media directly in and out of the database.

[InnoDB系列] -- hp vs dell and 5.0.45 vs 5.1.26 测试

声明:本文拒绝任何形式的转载,如有违者,将保留追究权利!

用sysbench做测试,--max-requet=100000 --num-thread=8 --mysql-table-engine=innodb

dell 2950(8g ram) vs hp 360g5(8g ram),/home 均做成4块盘的raid1+0。
从下面的测试结果来看,hp要比dell的机器稍好一点,但如果只是用dd做简单文件拷贝测试,则dell会比hp的机器快。

技术相关:

[InnoDB系列] -- 实测ibbackup vs mysqldump

前言:随着数据量的增加,备份问题会越来越突出,尤其是当前没有免费热备工具的情形下。本文针对 InnoDB 的备份需求,采用商业的 ibbackup 以及免费的 mysqldump 2种工具进行对比,让大家有个大致的了解。

 

1. 准备

ibbackupInnoDB 提供的收费工具,它支持在线热备 InnoDB 数据,主要有以下特性:

  • * Online backup of InnoDB tables — the backup takes place entirely online, without preventing queries or updates.
  • * Online backup of MyISAM tables — during the backup of InnoDB tables, read and write access is permitted to MyISAM tables. While the MyISAM tables are being copied, updates (but not reads) to the MyISAM tables are precluded.
  • * Compressed backups — the backup of InnoDB files can be compressed at various levels, saving as much as 70% or more of the storage required.
  • * Partial backups — you can selectively backup all or only some of your InnoDB tables.
  • * High performance — backup time is comparable to file copy, applying logs for recovery is even faster.
  • * Unlimited database size — no practical limit to database size or number of tables.
  • * Broad platform support — runs on Linux, Windows and leading Unix platforms.

技术相关:

[InnoDB系列] - 实例解析Innodb的隔离级别以及锁模式

1、隔离级别为:READ COMMITTED

 

READ COMMITTED

一个有些象Oracle的隔离级别。所有SELECT ... FOR UPDATE和SELECT ... LOCK IN SHARE
MOD语句仅锁定索引记录,而不锁定记录前的间隙,因而允许随意紧挨着已锁定的记录插入新记录。UPDATE和DELETE语句使用一个带唯一搜索条件的唯一的索引仅锁定找到的索引记录,而不包括记录前的间隙。在范围类型UPDATE和DELETE语句,InnoDB必须对范围覆盖的间隙设置next-key锁定或间隙锁定以及其它用户做的块插入。这是很必要的,因为要让MySQL复制和恢复起作用,“幽灵行”必须被阻止掉。

[InnoDB系列] -- innodb表如何更快得到count(*)结果

起因:在innodb表上做count(*)统计实在是太慢了,因此想办法看能不能再快点。
现象:先来看几个测试案例,如下
一、 sbtest 表上的测试

show create table sbtest\G
*************************** 1. row ***************************
Table: sbtest
Create Table: CREATE TABLE `sbtest` (
`aid` bigint(20) unsigned NOT NULL auto_increment,
`id` int(10) unsigned NOT NULL default '0',
`k` int(10) unsigned NOT NULL default '0',
`c` char(120) NOT NULL default '',
`pad` char(60) NOT NULL default '',
PRIMARY KEY  (`aid`),
KEY `k` (`k`),
KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1000001 DEFAULT CHARSET=latin1

技术相关:

UPDATE 时主键冲突引发的思考

假设有一个表,结构如下:

mysql> CREATE TABLE `a` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `id2` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM;

页面

Subscribe to RSS - InnoDB