求助大神们,多表查询用什么办法提高速度啊?

浏览:721 发布日期:2017/12/05 分类:ThinkPHP5专区 关键字: tp5 多表 join
现在数据80W+
运行时间 : 7.791278s [ 吞吐率:0.13req/s ] 内存消耗:3,241.43kb 文件加载:77$join = [
            ['bbs_group w','a.gid=w.id'],
            ['admin_member c','a.uid=c.id'],
        ];
        cache('index_topic_list',NULL);
        $map['a.status']=1;
        $topic_list = db('bbs_topic')->alias('a')->where($map)
        ->cache('index_topic_list')
        ->join($join)
        ->order('a.settop desc,a.create_time desc')
        ->field('c.id uid,w.id gid,a.id,w.name,a.title,c.nick,c.avatar,a.create_time,a.experience,a.type,a.reply,a.choice,a.settop')
        ->limit(16)->select();
        $this->assign('topic_list', $topic_list);
        return $this->fetch();
最佳答案
评论( 相关
后面还有条评论,点击查看>>