"Brion Vibber" <brion(a)pobox.com> wrote in
message news:3F081435.1070100@pobox.com...
Tim Starling wrote:
...
>* Article::showArticle() loads the link table with
LinkCache::preFill(),
>then calls LinkCache::clear(), which clears the cache but leaves a copy
of
it hidden away.
It then refills the cache with the new link table.
(Haven't looked at it in much detail yet.) Hmm, does this mean we take
the overhead of a double cache on every page view? We should only need
it when saving pages. I suppose in most cases it's the least of our
troubles though. :)
No, showArticle() is only called from insertNewArticle() and
updateArticle(). In fact, it doesn't show anything at all, it just updates
some tables and sends a redirect.
>* LinksUpdate::doUpdate() calls
LinkCache::incrementalSetup(), which
works
>out what needs to be added and deleted, and
applies a simple formula to
>decide whether the old way or the new way should be quicker.
>* The new way deletes links row by row, and then adds the new ones using
a
single insert.
Blanking large articles would be slow, hence that would be
done the old way.
It may be a touch more efficient to do the deletes in one query, such as:
$sql = "DELETE FROM links WHERE l_from='{$this->mTitleEnc}' AND l_to IN
("
. implode( ",", $del) . ")";
I'll take your word for it. MySQL is still pretty much a mystery to me.
-- Tim Starling.