Brion Vibber wrote:
Now, separately for each and every linked page:
Check if it exists:
LinkCache::addLink:SQL: SELECT cur_id FROM cur
WHERE (cur_namespace=0 AND cur_title='A_link')
I think that's one of the big evils. How many pages are linked from the
Main Page alone? 50? 100?
WIth stub detector and all, the other queries sum up to 10...
This is how I worked around that problem (well, sorta) in Phase II:
There's a field in the cur table with all "known as existing" links, a
single string with a separator ("\n") between the entries. It got loaded
together with the article from the database. Now, we'd only have to
check all the links that are *not* in that list, and eventually update
the field if new articles were created. This would be done on viewing.
The major drawback of that seemed to be the stunt I had to pull for
every page deletion, as you'd have to fulltext-search through all of
these fields.
As page deletion is a rather rare event compared to viewing, it might
pay off in the long run.
All there'd be to do is to add a field (tinyblob) to the cur table, then
add the checking/auto-update code on the view routine, and patch the
page deletion code.
Maybe cleaning of the field might be appropriate on occasion (when
moving an article, maybe).
Using the links/brokenlinks table instead will not do any good, IMHO;
which table we search doesn't really matter, and the links table is
longer...
Magnus