MariaDB社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2716|回复: 2
打印 上一主题 下一主题

InnoDb的性能很差吗?

[复制链接]
跳转到指定楼层
1#
发表于 2013-4-27 11:15:33 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
第一次用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 pages  2784
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[5022]:cur[0], unzip sum[0]:cur[0]
--------------

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 转播转播 分享分享 分享淘帖 顶 踩
2#
发表于 2013-4-27 14:21:07 | 只看该作者
explain看下执行计划
3#
 楼主| 发表于 2013-4-27 15:37:16 | 只看该作者
admin 发表于 2013-4-27 14:21
explain看下执行计划

explain 发现使用到了这两个字段的索引


1000W的数据量 查询出一个月的记录数(400w)  就耗时4秒左右,,,是不是太久了?!

令外 我的内存设置有问题吗?

Free Buffers             1      什么意思??


您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|手机版|MariaDB社区 ( 京ICP备07012489号    |
业务联系: QQ:48474881; 邮箱: 48474881@qq.com; 电话:13911732319
声明:本站部分文章是网友转载,若未经作者同意或署名有误,请联系网站管理员。

GMT+8, 2024-9-20 10:26 , Processed in 0.076198 second(s), 19 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表