标题: php 加个数据索引需要改数据库吗
时间: 2018-05-04
$sql="select article.id,article.user,article.title,article.time from article where a='0' and lmid='{$id}' order by time desc limit {$page},10";
php菜鸟级别,用上面的sql列出一个栏目的所有文章,20000篇文章耗时需要0.6~0.7秒,听说加索引快,是不是还需要改数据库表啊?有没有适合新手带实例的教程,我在百度搜了好久都没弄明白,
手机
『回复列表(7|显示机器人聊天)』
做了一个替换,头像显示应该搞定了:
-- 影响了 1628 行。 (查询花费 0.0761 秒。)
update hu60_user set info=replace(info, 'http://www.wapvy.cn/uc_server/images/noavatar_small.gif', 'https://hu60.net/././././././././././upload/default.jpg')
(info里的内容是php数组,所以在不修改其结构的情况下只能等长替换)