From: Aaron Schulz Date: Tue, 2 Sep 2008 21:29:22 +0000 (+0000) Subject: Make getLatestRevID faster X-Git-Tag: 1.31.0-rc.0~45523 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/categories/modifier.php?a=commitdiff_plain;h=95bbbeb606e07cf328a7a3a395bfe009d01c8a3e;p=lhc%2Fweb%2Fwiklou.git Make getLatestRevID faster --- diff --git a/includes/Title.php b/includes/Title.php index 071334444e..1dbe78d6a1 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1979,14 +1979,14 @@ class Title { * @return \type{\int} */ public function getLatestRevID( $flags = 0 ) { - if ($this->mLatestID !== false) + if( $this->mLatestID !== false ) return $this->mLatestID; $db = ($flags & GAID_FOR_UPDATE) ? wfGetDB(DB_MASTER) : wfGetDB(DB_SLAVE); - return $this->mLatestID = $db->selectField( 'revision', - "max(rev_id)", - array('rev_page' => $this->getArticleID($flags)), - 'Title::getLatestRevID' ); + $this->mLatestID = $db->selectField( 'page', 'page_latest', + array( 'page_namespace' => $this->getNamespace(), 'page_title' => $this->getDBKey() ), + __METHOD__ ); + return $this->mLatestID; } /**