Changeset 424
- Timestamp:
- 07/15/09 07:25:24 (12 years ago)
- Location:
- dev/common/includes
- Files:
-
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/common/includes/class.db.mysqli.php
r404 r424 87 87 $t1 = strtok(microtime(), ' ') + strtok(''); 88 88 89 if(isset($this->resid_)) $this->resid_->free(); 90 89 91 $this->resid_ = mysqli_query($this->dbconn_->id(),$sql); 90 92 … … 196 198 // this is the minimum runtime a query has to run to be 197 199 // eligible for caching in seconds 198 $this->_minruntime = 0. 05;200 $this->_minruntime = 0.1; 199 201 200 202 // maximum size of a cached result set (512kB) … … 424 426 // we got no or no valid cache so open the connection and run the query 425 427 $this->dbconn_ = new DBConnection_mysqli(); 426 427 $t1 = strtok(microtime(), ' ') + strtok(''); 428 if(isset($this->resid_)) $this->resid_->free(); 429 430 $t1 = strtok(microtime(), ' ') + strtok(''); 428 431 429 432 $this->resid_ = mysqli_query($this->dbconn_->id(), $sql); … … 458 461 { 459 462 $this->genCache(); 463 // We will use the cached version now so free the mysqli resource. 464 if($this->_cached) 465 { 466 $this->resid_->free(); 467 unset($this->resid_); 468 } 460 469 } 461 470 … … 607 616 $this->_minruntime = 0.1; 608 617 609 // maximum size of a cached result set ( 1MB)610 $this->_maxcachesize = 1048576;618 // maximum size of a cached result set (512kB) 619 $this->_maxcachesize = 524288; 611 620 $this->d = true; 612 621 } … … 737 746 // we got no or no valid cache so open the connection and run the query 738 747 $this->dbconn_ = new DBConnection_mysqli; 748 if(isset($this->resid_)) $this->resid_->free(); 739 749 740 750 $t1 = strtok(microtime(), ' ') + strtok(''); -
dev/common/includes/class.db_memcache.php
r404 r424 15 15 $this->_minruntime = 0.1; 16 16 17 // maximum size of a cached result set ( 1MB)18 $this->_maxcachesize = 1048576;17 // maximum size of a cached result set (512kB) 18 $this->_maxcachesize = 524288; 19 19 $this->d = true; 20 20 } -
dev/common/includes/class.killlist.php
r399 r424 44 44 * 45 45 */ 46 $timeindex='kll_timestamp';47 46 if (!$this->qry_->executed_) 48 47 { … … 151 150 $this->sql_ .= $invop." ind.ind_crp_id IN (". 152 151 implode(',', $this->inv_crp_)." ) "; 152 $invop = "OR"; 153 153 } 154 154 if($this->inv_all_ ) … … 158 158 } 159 159 $this->sql_ .= ") ) "; 160 /* Faster on <50k mails, much slower on >500k161 $this->sql_ .= " INNER JOIN ";162 if($this->inv_plt_ && !($this->inv_crp_ || $this->inv_all_))163 {164 $this->sql_ .= " kb3_inv_detail ind ".165 "ON (kll.kll_id = ind.ind_kll_id AND ind.ind_plt_id IN (".166 implode(',', $this->inv_plt_)." ) ) ";167 }168 else169 {170 $unionop = " ( ";171 if($this->inv_plt_)172 {173 $indsqlp .= $unionop." SELECT DISTINCT ind_kll_id ".174 "FROM kb3_inv_detail ".175 "WHERE ind_plt_id IN (".implode(',', $this->inv_plt_)." ) ";176 $unionop = " UNION ";177 }178 if($this->inv_crp_)179 {180 $this->sql_ .= $unionop." SELECT DISTINCT ind_kll_id ".181 "FROM kb3_inv_detail WHERE ind_crp_id IN (".182 implode(',', $this->inv_crp_)." ) ";183 $unionop = " UNION ";184 }185 if($this->inv_all_) $this->sql_ .= $unionop." SELECT DISTINCT ind_kll_id FROM kb3_inv_detail WHERE ind_all_id IN (".186 implode(',', $this->inv_all_).") ";187 $this->sql_ .= ") ind ON (kll.kll_id = ind.ind_kll_id) ";188 }189 */190 160 } 191 161 // The first argument after WHERE affects sql optimisation so check -
dev/common/includes/globals.php
r423 r424 7 7 else 8 8 { 9 $svn_rev = '42 3';9 $svn_rev = '424'; 10 10 } 11 11 define('SVN_REV', $svn_rev);