Toolserver:Toolserver database

The "toolserver" database contains metadata about the various Wikimedia wikis and databases. It consists of four tables: language, namespace, namespacename, and wiki.

The "toolserver" database exists on every host, so it's possible to JOIN against it with every database. The database updates daily.

namespace
This table contains the primary namespace names for the wikis in the wiki table. Use of this table is deprecated, use the namespacename table instead, which covers all valid names for each namespace in each wiki, not just the primary names.

namespacename
This table is useful for localizing the namespace name in query results. For example: This query would produce:
 * TODO explain the difference between "primary" and "canonical" and which one to use on the English Wikipedia as this has changed from "primary"

wiki
This table is especially useful for looking up the host of a wiki database. For example: This query would produce: This tells you that the dewiki_p database is located on the sql-s5 host.

The wiki table is also useful for things like link generation. You can select the domain name from the table for a given database to create proper working hyperlinks.