dedecms織夢數據量達到萬級後 生成速度很慢解決辦法

織夢由於生成靜態文件原因及系統架構本身的原因,當數量達到萬級別後,生成欄目及文檔相當緩慢,今天織夢58介紹下,通過改動系統文件來提升生成速度,修改之前請大家做好織夢程序的備份。

1、先設置 關閉副欄目(在系統—-系統基本參數—性能選項裏)

2、一般網站不需要 欄目交叉 交叉 所以 找到94行註釋掉:

打開: include/arc.listview.class.php

找到以下代碼並註釋(註釋代碼爲:/*代碼*/):

/*
            //獲得交叉欄目ID
            if($this->TypeLink->TypeInfos['cross']>0 && $this->TypeLink->TypeInfos['ispart']==0)
            {
                $selquery = '';
                if($this->TypeLink->TypeInfos['cross']==1)
                {
                    $selquery = "SELECT id,topid FROM `#@__arctype` WHERE typename LIKE '{$this->Fields['typename']}' AND id<>'{$this->TypeID}' AND topid<>'{$this->TypeID}'  ";
                }
                else
                {
                    $this->Fields['crossid'] = preg_replace('/[^0-9,]/', '', trim($this->Fields['crossid']));
                    if($this->Fields['crossid']!='')
                    {
                        $selquery = "SELECT id,topid FROM `#@__arctype` WHERE id in({$this->Fields['crossid']}) AND id<>{$this->TypeID} AND topid<>{$this->TypeID}  ";
                    }
                }
                if($selquery!='')
                {
                    $this->dsql->SetQuery($selquery);
                    $this->dsql->Execute();
                    while($arr = $this->dsql->GetArray())
                    {
                        $this->CrossID .= ($this->CrossID=='' ? $arr['id'] : ','.$arr['id']);
                    }
                }
            }
*/

繼續查找並註釋:

/*
        //獲得附加表的相關信息
        $addtable  = $this->ChannelUnit->ChannelInfos['addtable'];
        if($addtable!="")
        {
            $addJoin = " LEFT JOIN `$addtable` ON arc.id = ".$addtable.'.aid ';
            $addField = '';
            $fields = explode(',',$this->ChannelUnit->ChannelInfos['listfields']);
            foreach($fields as $k=>$v)
            {
                $nfields[$v] = $k;
            }
            if(is_array($this->ChannelUnit->ChannelFields) && !empty($this->ChannelUnit->ChannelFields))
            {
                foreach($this->ChannelUnit->ChannelFields as $k=>$arr)
                {
                    if(isset($nfields[$k]))
                    {
                        if(!empty($arr['rename'])) {
                            $addField .= ','.$addtable.'.'.$k.' as '.$arr['rename'];
                        }
                        else {
                            $addField .= ','.$addtable.'.'.$k;
                        }
                    }
                }
            }
        }
        else
        {
            $addField = '';
            $addJoin = '';
        }
*/

下面是已經修改過的文件
點擊下載arc.listview.class

未經允許不得轉載:鄭州seo|不知則問,不能則學!-鄭州金尊国际 » dedecms織夢數據量達到萬級後 生成速度很慢解決辦法

'); })();