* Optimize bug browse query.
This commit is contained in:
@@ -36,3 +36,6 @@ MODIFY COLUMN `subject` text NOT NULL AFTER `ccList`,
|
||||
DROP INDEX `objectType_toList_status`,
|
||||
ADD INDEX `objectType`(`objectType` ASC),
|
||||
ADD INDEX `status`(`status` ASC);
|
||||
|
||||
CREATE INDEX deleted ON zt_bug (deleted);
|
||||
CREATE INDEX product_status_deleted ON zt_bug (product,status,deleted);
|
||||
|
||||
@@ -172,7 +172,7 @@ class bug extends control
|
||||
}
|
||||
else
|
||||
{
|
||||
$executions = $this->loadModel('execution')->getPairs($this->projectID, 'all', 'empty|withdelete|hideMultiple');
|
||||
$executions = $this->loadModel('execution')->fetchPairs($this->projectID, 'all', 'empty|withdelete|hideMultiple');
|
||||
if($this->config->cache->enable) $this->cache->set($cacheKey, $executions);
|
||||
}
|
||||
|
||||
@@ -234,7 +234,6 @@ class bug extends control
|
||||
$this->view->position[] = $this->lang->bug->common;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->product = $product;
|
||||
$this->view->projectProducts = $this->product->getProducts($this->projectID);
|
||||
$this->view->productName = $productName;
|
||||
$this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $branch);
|
||||
$this->view->releasedBuilds = $this->loadModel('release')->getReleasedBuilds($productID, $branch);
|
||||
|
||||
@@ -2861,7 +2861,8 @@ class bugModel extends model
|
||||
->beginIF($projectID)->andWhere('project')->eq($projectID)->fi()
|
||||
->andWhere('deleted')->eq(0)
|
||||
->beginIF(!$this->app->user->admin)->andWhere('project')->in('0,' . $this->app->user->view->projects)->fi()
|
||||
->orderBy($orderBy)->page($pager)
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user