Magnus Manske wrote:
Now that 1.5 is running, and the big bugs bite^W are
on the verge of
extinction, I feel it is my duty to introduce some new ones. :-)
Did anyone look into the validation feature again? I have fixed what
seemed to be the most pressing problems.
It was last modified June 22. If you've made changes since, I don't
think they got checked in. :)
I'm not sure about performance,
but I'm pretty sure it doesn't load the whole table into memory at any
point.
Well, about that...
# Reads all revision information of the specified article
function prepareRevisions( $id ) {
global $wgDBprefix;
$this->rev2date = array();
$this->date2rev = array();
$sql = "SELECT * FROM {$wgDBprefix}revision WHERE rev_page='{$id}'";
$res = wfQuery( $sql, DB_READ );
while( $x = wfFetchObject( $res ) ) {
$this->rev2date[$x->rev_id] = $x;
$this->date2rev[$x->rev_timestamp] = $x;
}
}
That function gets called in validatePageForm, showDetails, and
showList. As near as I can tell there's basically nothing you can touch
in the validation feature that won't try to load the complete revision
history of the page -- which may be thousands or tens of thousands of
revisions for certain pages.
It may not have to load up the page text anymore, but that's still a lot
of records and a lot of fields being scraped off the database's disk and
dumped into memory on the web server.
That's the first function defined in the file, so there may be other
interesting problems lower down as well that need attention, but it's a
big one.
There has been a request for the feature on the German
mailing list, and
I'd wager it won't stay the only one, on many lists.
Should we
* sit back and wait for it to mend itself magically
* let everyone have a final look and turn it on to see what happens
* turn it on right now
It must not be turned on until it's been fixed.
(I would also recommend moving it out of the core code and making it an
extension if possible.)
-- brion vibber (brion @
pobox.com)