MYSQL引擎简单对比
服务器业务类型对比 性能瓶颈
DB I/O磁盘
转发服务器 网卡PPS
动态WEB前台 CPU
静态WEB前台 网卡 (流量)
ACID原则
MYSQL 引擎
MYISAM 表锁 低并发使用 非簇INDEX
INNODB 行锁 高并发使用 簇INDEX
建表:
MYISAM
按获取的值一个个创建,不会进行排序。如 1,aa;13,aa;11,aa 输入,在数据表中为1,aa;13,aa;11,aa三条记录
INNODB
进行排序后创建。如 1,aa;13,aa;11,aa 输入,在数据表中为1,aa;11,aa,13,aa三条记录
原因是什么?非簇INDEX关系
查询
ID是INDEX
MYISAM
select count(*) from xxx; 快
因为是统计量另存一个地方,直接去取值
select * from xxx where id>1; 慢
非簇INDEX关系,索引KEY存放在一个节点,数据放在另一地方,通过指针获取。
select id from xxx where id>1; 快
只读取索引列表
INNODB
select count(*) from xxx; 慢
一行行统计
sleect * from xxx where id>1; 快
簇INDEX关系,索引KEY和数据放在一地方。
select id from xxx where id>1; 慢
一个个去读。
写给自己看,初步理解,有待加强,错误难免。
如何写表名或者字段名是变量的参数查询?
declare @sql varchar(200)
set @sql='select * from ' + @table_name
execute(@sql)
相关文档:
现在新版本的mysql集群已从普通的mysql版本中提取出来了,也就是要做mysql的集群需要选择mysql集群对应的软件包。而且mysql专门提供了针对redhat 操作系统的rpm软件包。可以从http://dev.mysql.com/downloads/获得对应的操作系统的rpm软件包。在这里主 ......
表设计方面:
1、字段名尽量简化,不要超过18个字符
2、使用尽量小的数据类型,例如:MEDIUMINT比INT少占用25%空间
3、字段类型应尽量避免设置成可变长度,如:VARCHAR、BLOB、TEXT
4、用于比较的不同字段,应设置相同的类型及长度
5、尽可能将字段声明为NOT NULL,并指定DEFAULT
6、主索引尽可能短
7、仅创建真正 ......
NDBCLUSTER
(also known as NDB
) is an in-memory
storage engine offering high-availability and data-persistence
features.
The NDBCLUSTER
storage engine can be
configured with a range of failover and load-balancing options,
but it is easiest t ......
sudo apt-get install mysql-server mysql-client
sudo apt-get install sun-java6-jdk(安装出意外,sudo dpkg -P sun-java6-bin,然后重新安装)
sudo vi /etc/network/interfaces 配置网络
auto eth0
iface eth0 inet dhcp(static)
address 192.168.8.108
netmask 255.255.255.0
gateway 192.168.8.1
:x保存
sud ......
This section is a “How-To
” that describes the basics
for how to plan, install, configure, and run a MySQL Cluster.
Whereas the examples in
Chapter 3, MySQL Cluster Configuration
provide more in-depth
information on a variety of clustering options and co ......