因为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
解决方案 »
- mysql怎么没有configure这玩意~~
- mysql做 论坛数据库 用myISAM 好还是InnoDB好 谢谢!
- MYSQL 全文检索, ORDER BY relevance
- mysql统计查询问题
- select * from `table` where `id` in (3,2,1,5) 列出的记录能不能按3,2,15排序?谢谢
- 如何用 share storage 来做 MySQL 的 cluster 环境呢?
- 请问在mysql中有无根据2条SQL语句的结果进行分页的方法
- php 连接postgresql的问题
- 能给我推荐几个linux上的免费的数据库吗,如postgresql
- mysql里字符集的一些事
- 导入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我帮下我 万分感谢啊