因为vps问题 数据库崩溃了 不明原因直接丢失了
不过发现的问题在这里求高手解答一下先数据库结构是这样的
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(1000) DEFAULT '',
`mastertype` varchar(50) DEFAULT '',
`type` varchar(50) DEFAULT '',
`poster` varchar(300) DEFAULT '',
`createtime` int(11) DEFAULT '0',
`lasttime` int(11) DEFAULT '0',
`hits` int(11) DEFAULT '0',
`gut` text,
`come` varchar(300) DEFAULT '',
PRIMARY KEY (`id`),
KEY `lasttimeindex` (`lasttime`) USING BTREE,
KEY `mastertypeindex` (`mastertype`) USING BTREE,
KEY `typeindex` (`type`) USING BTREE,
KEY `hitsindex` (`hits`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;当数据量不大的时候 因为我有4个索引 当用hits索引来使用的时候貌似在40W数据的时候也还是很快 还有id一样
当是当我用lasttime来索引的时候发现超级慢 lasttime是int类型 是时间戳格式的 这个大概会是什么原因造成呢
是和lasttime的长度大小有关系 hits也是int 貌似就很快如果需要具体的数据 等我服务器重新架设好后explain
不过发现的问题在这里求高手解答一下先数据库结构是这样的
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(1000) DEFAULT '',
`mastertype` varchar(50) DEFAULT '',
`type` varchar(50) DEFAULT '',
`poster` varchar(300) DEFAULT '',
`createtime` int(11) DEFAULT '0',
`lasttime` int(11) DEFAULT '0',
`hits` int(11) DEFAULT '0',
`gut` text,
`come` varchar(300) DEFAULT '',
PRIMARY KEY (`id`),
KEY `lasttimeindex` (`lasttime`) USING BTREE,
KEY `mastertypeindex` (`mastertype`) USING BTREE,
KEY `typeindex` (`type`) USING BTREE,
KEY `hitsindex` (`hits`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;当数据量不大的时候 因为我有4个索引 当用hits索引来使用的时候貌似在40W数据的时候也还是很快 还有id一样
当是当我用lasttime来索引的时候发现超级慢 lasttime是int类型 是时间戳格式的 这个大概会是什么原因造成呢
是和lasttime的长度大小有关系 hits也是int 貌似就很快如果需要具体的数据 等我服务器重新架设好后explain
解决方案 »
- 请教一条查询SQL的写法
- 求救insert into 的问题?
- 【救命 !】 用命令行把字段 gbk_chinese_ci转换gbk bin 后 都变乱码了
- 存储过程定义变量时需要其传入参数加1
- if then else的问题
- 联接两个数据库中的两个表,要求先对一个表进行排序后分组
- Mysql trigger 问题
- mysql5。1是否有在线应用的例子
- 急急急!!mysql主从服务器的启动问题
- 已安装了postgresql 7。3的linux用什么命令访问,查看另一台机器上的posgresql数据库?在线等待~~~~~~~~~
- 导入sql文件时,提示[Err] 1146 - Table 'jieyuenew.cmjobcode' doesn't exist
- mysql误导入了数据,把原来的数据覆盖掉了,这个有办法还原吗?
select * from ys_films order by lasttime desc limit xxx,20
+----+-------------+----------+-------+---------------+---------------+---------+------+--------+-------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+----------+-------+---------------+---------------+---------+------+--------+-------+
| 1 | SIMPLE | ys_films | index | NULL | lasttimeindex | 5 | NULL | 400020 | |
+----+-------------+----------+-------+---------------+---------------+---------+------+--------+-------+
貌似是起到作用了 卡住 是我取的台后面的数据 所以要检索40w开始后的20条 就很慢 这个问题如何解决 2.
explain select * from ys_films where title like '%中英文%' limit 10;
+----+-------------+----------+------+---------------+------+---------+------+--------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+----------+------+---------------+------+---------+------+--------+-------------+
| 1 | SIMPLE | ys_films | ALL | NULL | NULL | NULL | NULL | 431696 | Using where |
+----+-------------+----------+------+---------------+------+---------+------+--------+-------------+40万的数据 用like %中英文% 来检索如何提高效率 如果like %中英文%这样的方式没法提交性能和效率 是否是要用中文的全文检索 有什么好的推荐的中文的全文检索 对服务器要求高吗 希望高手解答 或者直接Q我帮下我 万分感谢啊