Because Category:MediaWiki database tables lists the tables that built-in to MediaWiki. These tables can contain highly sensitive data, such as hashes of passwords, tokens, IP addresses, revision-deleted or oversighted revision comments, etc. Therefore, when these databases are replicated to wiki replicas, which Quarry queries from, some tables like revision
must redact some cells from a raw when a certain criteria is met.
We implement some of the redaction by not replication some tables at all, and some other redaction by using views. As for your query, the relevant redaction in view (not table) revision
is if((`enwiki`.`revision`.`rev_deleted` & 4),NULL,`enwiki`.`revision`.`rev_user`) AS `rev_user`
, which makes rev_user
NULL
when rev_deleted
has bit 2^2 (for revdel-ed username) set. As a side effect of using this if
, indexes in the table revision
for rev_user
cannot be used.
Since unusable indexes is a serious performance problem, the DBAs made alternative views that redact the rows entirely. This is the case of view revision_userindex
, where the definition includes and `enwiki`.`revision`.`rev_user` AS `rev_user`
and where ((`enwiki`.`revision`.`rev_deleted` & 4) = 0)
. rev_user
is now a simple passthrough, allowing use of indexes on that column; the bit condition in rev_deleted
is now an implicit but enforced where condition to the underlying revision
table that we cannot query directly.
So no, we don't have two copies of the table, but two views of the same table.