* (bug 7309) Plurals: use singular form for zero in French and Brazilian Portuguese
* Add page_no_title_convert field to support language variant conversion
for page titles which shouldn't be converted on display/linking
+* Lazy extraction of text chunks in Revision objects, may reduce hits to
+ external storage when actual text content is not used
== Languages updated ==
$this->mTitle = null;
}
+ // Lazy extraction...
+ $this->mText = null;
if( isset( $row->old_text ) ) {
- $this->mText = $this->getRevisionText( $row );
+ $this->mTextRow = $row;
} else {
- $this->mText = null;
+ // 'text' table row entry will be lazy-loaded
+ $this->mTextRow = null;
}
} elseif( is_array( $row ) ) {
// Build a new revision to be saved...
function loadText() {
$fname = 'Revision::loadText';
wfProfileIn( $fname );
-
- $dbr =& wfGetDB( DB_SLAVE );
- $row = $dbr->selectRow( 'text',
- array( 'old_text', 'old_flags' ),
- array( 'old_id' => $this->getTextId() ),
- $fname);
+
+ // If we kept data for lazy extraction, use it now...
+ $row = $this->mTextRow;
+ $this->mTextRow = null;
+
+ if( !$row ) {
+ // Text data is immutable; check slaves first.
+ $dbr =& wfGetDB( DB_SLAVE );
+ $row = $dbr->selectRow( 'text',
+ array( 'old_text', 'old_flags' ),
+ array( 'old_id' => $this->getTextId() ),
+ $fname);
+ }
if( !$row ) {
+ // Possible slave lag!
$dbw =& wfGetDB( DB_MASTER );
$row = $dbw->selectRow( 'text',
array( 'old_text', 'old_flags' ),