On Fri, Mar 20, 2009 at 1:08 PM, O. O.
<olson_ot(a)yahoo.com> wrote:
I cannot understand why there are more redirects
in the redirect table
than there are in the pages in the Page table with the redirect flag set.
select count(*) from wikidb.redirect ; --- Gives 3422938
while
select count(*) from wikidb.page where page_is_redirect=1; --- Gives
3242340
Why should there be this difference? Are there redirects that are not
listed in the Page Table?
It's denormalized data, so I'd assume that those are just errors of
some kind. If you need to be really really sure whether something is
a redirect, you have to parse its text (it's just a regex, should be
somewhere in includes/Article.php or something). That's the
authoritative check, which IIRC is used when actually deciding whether
to redirect.
As,
SELECT count(*) FROM wikidb.page JOIN wikidb.redirect ON
rd_from=page_id; --- Gives 3210708
Which is less than the total rows in the Redirect Table i.e.
select count(*) from wikidb.redirect ; --- Gives 3422938 which is
more than 3210708
I think this might mean that there are entries in the Redirect Table
where the rd_from does not correspond to a valid page_id in the Page
Table? I don’t know what these would be used for though.
Thanks again,
O. O.