faster with MyISAM tables than with InnoDB or NDB tables
http://dev.mysql.com/doc/refman/5.7/en/partitioning-limitations.html
Performance considerations. Some effects of partitioning operations on performance are given in the following list:
File system operations. Partitioning and repartitioning operations (such as
ALTER TABLEwithPARTITION BY ...,REORGANIZE PARTITIONS, orREMOVE PARTITIONING) depend on file system operations for their implementation. This means that the speed of these operations is affected by such factors as file system type and characteristics, disk speed, swap space, file handling efficiency of the operating system, and MySQL server options and variables that relate to file handling. In particular, you should make sure thatlarge_files_supportis enabled and thatopen_files_limitis set properly. For partitioned tables using theMyISAMstorage engine, increasingmyisam_max_sort_file_sizemay improve performance; partitioning and repartitioning operations involvingInnoDBtables may be made more efficient by enablinginnodb_file_per_table.See also Maximum number of partitions.
MyISAM and partition file descriptor usage. For a partitioned
MyISAMtable, MySQL uses 2 file descriptors for each partition, for each such table that is open. This means that you need many more file descriptors to perform operations on a partitionedMyISAMtable than on a table which is identical to it except that the latter table is not partitioned, particularly when performingALTER TABLEoperations.Assume a
MyISAMtabletwith 100 partitions, such as the table created by this SQL statement:CREATE TABLE t (c1 VARCHAR(50))
PARTITION BY KEY (c1) PARTITIONS 100
ENGINE=MYISAM;NoteFor brevity, we use
KEYpartitioning for the table shown in this example, but file descriptor usage as described here applies to all partitionedMyISAMtables, regardless of the type of partitioning that is employed. Partitioned tables using other storage engines such asInnoDBare not affected by this issue.Now assume that you wish to repartition
tso that it has 101 partitions, using the statement shown here:ALTER TABLE t PARTITION BY KEY (c1) PARTITIONS 101;
To process this
ALTER TABLEstatement, MySQL uses 402 file descriptors—that is, two for each of the 100 original partitions, plus two for each of the 101 new partitions. This is because all partitions (old and new) must be opened concurrently during the reorganization of the table data. It is recommended that, if you expect to perform such operations, you should make sure that--open-files-limitis not set too low to accommodate them.Table locks. The process executing a partitioning operation on a table takes a write lock on the table. Reads from such tables are relatively unaffected; pending
INSERTandUPDATEoperations are performed as soon as the partitioning operation has completed.Storage engine. Partitioning operations, queries, and update operations generally tend to be faster with
MyISAMtables than withInnoDBorNDBtables.Indexes; partition pruning. As with nonpartitioned tables, proper use of indexes can speed up queries on partitioned tables significantly. In addition, designing partitioned tables and queries on these tables to take advantage of partition pruning can improve performance dramatically. SeeSection 21.4, “Partition Pruning”, for more information.
Previously, index condition pushdown was not supported for partitioned tables. This limitation was removed in MySQL 5.7.3. See Section 9.2.1.6, “Index Condition Pushdown Optimization”.
Performance with LOAD DATA. In MySQL 5.7,
LOAD DATAuses buffering to improve performance. You should be aware that the buffer uses 130 KB memory per partition to achieve this.
faster with MyISAM tables than with InnoDB or NDB tables的更多相关文章
- Mysql更换MyISAM存储引擎为Innodb的操作记录
一般情况下,mysql会默认提供多种存储引擎,可以通过下面的查看: 1)查看mysql是否安装了innodb插件.通过下面的命令结果可知,已经安装了innodb插件. mysql> show p ...
- MySQL优化篇系列文章(二)——MyISAM表锁与InnoDB锁问题
我可以和面试官多聊几句吗?只是想... MySQL优化篇系列文章(基于MySQL8.0测试验证),上部分:优化SQL语句.数据库对象,MyISAM表锁和InnoDB锁问题. 面试官:咦,小伙子,又来啦 ...
- InnoDB INFORMATION_SCHEMA System Tables
InnoDB INFORMATION_SCHEMA System Tables 可以使用InnoDB INFORMATION_SCHEMA系统表提取有关InnoDB管理的schema对象的元数据. 此 ...
- InnoDB INFORMATION_SCHEMA Lock Tables
InnoDB INFORMATION_SCHEMA Lock Tables 三张InnoDB INFORMATION_SCHEMA表使您能够监视事务并诊断潜在的锁定问题: INNODB_TRX:提供有 ...
- MySQL数据库MyISAM存储引擎转为Innodb
MySQL数据库MyISAM存储引擎转为Innodb 之前公司的数据库存储引擎全部为MyISAM,数据量和访问量都不是很大,所以一直都没什么问题.但是最近出现了MySQL数据表经常被锁的情况,直接导 ...
- MyISAM的key_buffer_size和InnoDB的innodb_buffer_pool_size
一.MyISAM的key_buffer_size MyISAM的索引方式是非聚集索引,主索引和其他索引没有本质区别,在data域都是存储了具体记录行的地址.key_buffer_size规定了系统将多 ...
- MySQL存储引擎 -- MyISAM(表锁定) 与 InnoDB(行锁定) 锁定机制
前言 为了保证数据的一致完整性,任何一个数据库都存在锁定机制.锁定机制的优劣直接应想到一个数据库系统的并发处理能力和性能,所以锁定机制的实现也就成为了各种数据库的核心技术之一.本章将对MySQL中两种 ...
- FLUSH TABLES WITH READ LOCK 和 LOCK TABLES比较
1.FLUSH TABLES WITH READ LOCK 这个命令是全局读锁定,执行了命令之后所有库所有表都被锁定只读.一般都是用在数据库联机备份,这个时候数据库的写操作将被阻塞,读操作顺利进行.解 ...
- Fusion Tables 图层用于呈现 Google Fusion Tables 中包含的数据
Google Maps API 允许您使用 FusionTablesLayer 对象将 Google Fusion Tables 中包含的数据呈现为地图上的图层.Google Fusion Table ...
随机推荐
- POJ1815 Friendship(字典序最小最小割割边集)
看了题解.当时也觉得用邻接矩阵挺好写的,直接memset:然而邻接矩阵不懂得改,于是就放开那个模板,写了Dinic.. 方法是,按字典序枚举每一条满流的边,然后令其容量减1,如果最大流改变了,这条边就 ...
- json日期格式问题的办法
//json日期转换 格式(2015-01-01) <input class="easyui-datebox" name="sbdj_txtShebaoka_Lin ...
- Ubuntu下SVN配置
今天上午写了一个脚本,然后想起来现在写的R脚本,常常在分析过程中就直接改掉了.隐隐还是觉得存在隐患,想着svn部署应该不会太难,于是就直接动手干了. 弄了一上午的时间,感觉还是花了点时间. 这里有篇b ...
- MyBatis 缓存问题 session
iBatis(MyBatis)开启缓存后,通过外部程序修改或者删除数据库记录,如何让Cache清除?5 当其外部的数据库连接甚至是数据库管理系统,对数据库进行了更改,iBatis(MyBatis)的缓 ...
- Codeforce - Rock-Paper-Scissors
Rock-Paper-Scissors is a two-player game, where each player chooses one of Rock, Paper, or Scissors. ...
- 腾讯 pc端面试(2015.10.26)
整个面试过程全部围绕着我在前一家公司做过的项目开始提问.因为这个项目是我主要负责的,所以面试官第一个问题是让我讲解了整个项目的框架结构.在对于项目的框架结构的讲解方面,大致条理还算清醒但是因为很少对做 ...
- 十、ios 模态窗口[实例]
一.模态窗口概念 对话框一般分为两种类型:模态类型( modal )与非模态类型( modeless ).所谓模态对话框,就是指除非采取有效的关闭手段,用户的鼠标焦点或者输入光标将一直停留在其上的对话 ...
- Go语言练习:网络编程实例——简易图片上传网站
1.代码结构 2.运行实例 1.代码结构 $ tree . ├── photoweb.go ├── public │ ├── css │ ├── images │ └── js ├── u ...
- linux下使用线程锁互斥访问资源
linux使用线程锁访问互斥资源: 1.线程锁的创建 pthread_mutex_t g_Mutex; 2.完整代码如下 #include <stdio.h> #include <s ...
- C#操作文件夹及文件的方法的使用
本文收集了目前最为常用的C#经典操作文件的方法,具体内容如下:C#追加.拷贝.删除.移动文件.创建目录.递归删除文件夹及文件.指定文件夹下面的所有内容copy到目标文件夹下面.指定文件夹下面的所有内容 ...