InnoDb的性能很差吗?
第一次用mysql 知道怎么优化一张1000W的表 20个字段
select count(1) from table where datetime >t1 and datetime<t2 500毫秒
select count(1) from table where datetime >t1 and datetime<t2 and int(2)字段=1 3秒
datetime字段和int(2)字段都有索引 为何这么慢呢??
看不懂那些参数配置 哪位给指点下? 先行谢过了。。。。:)
内存配置如下:
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 6593445888; in additional pool allocated 0
Dictionary memory allocated 5973700
Buffer pool size 393216
Free buffers 1
Database pages 386409
Old database pages 142619
Modified db pages2784
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 23895, not young 0
12.63 youngs/s, 0.00 non-youngs/s
Pages read 434536, created 25214, written 1923003
6.67 reads/s, 1.11 creates/s, 127.74 writes/s
Buffer pool hit rate 998 / 1000, young-making rate 5 / 1000 not 0 / 1000
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 386409, unzip_LRU len: 0
I/O sum:cur, unzip sum:cur
--------------
explain看下执行计划
admin 发表于 2013-4-27 14:21 static/image/common/back.gif
explain看下执行计划
explain 发现使用到了这两个字段的索引
。
1000W的数据量 查询出一个月的记录数(400w)就耗时4秒左右,,,是不是太久了?!
令外 我的内存设置有问题吗?
Free Buffers 1 什么意思??
页:
[1]