Manual:Database layout

From MediaWiki.org
(Redirected from Database)
Jump to: navigation, search

Other languages:
العربية • ‎Deutsch • ‎English • ‎español • ‎suomi • ‎français • ‎Bahasa Indonesia • ‎italiano • ‎日本語 • ‎lietuvių • ‎Nederlands • ‎polski • ‎português • ‎português do Brasil • ‎русский • ‎slovenčina • ‎中文
Schema redirects here; for information about the Schema: namespace, see Extension:EventLoggingExtension:EventLogging.
Tables redirects here; for information about wikitext table syntax, see Help:TablesHelp:Tables.


Manual:ContentsManual:Contents MediaWiki database layoutManual:Database layout database layout


(file description page)

The SQL code that creates the MySQL/MariaDBManual:MySQL core tables for any MediaWiki version—with extensive comments—is in the maintenance/tables.sql source file. The most important tables are probably pageManual:page table, revisionManual:revision table, textManual:text table and userManual:user table.

Version history[edit]

The following table depicts the range of MediaWiki versions over which each table has existed in the schema. Red rows indicate tables that are no longer used by the core nor added by the installer as of a particular version. They might however still be used by extensions. Note, table headings are repeated every 10 rows for clarity.

1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19 1.20 1.21 1.22 1.23 1.24 1.25 1.26 1.27 1.28 master
archiveManual:archive table
  blobsManual:blobs table  
  bot_passwordsManual:bot_passwords table
brokenlinksManual:brokenlinks table  
  categoryManual:category table
  categorylinksManual:categorylinks table
  change_tagManual:change_tag table
curManual:cur table  
  externallinksManual:externallinks table
  external_userManual:external_user table  
1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19 1.20 1.21 1.22 1.23 1.24 1.25 1.26 1.27 1.28 master
  filearchiveManual:filearchive table
hitcounterManual:hitcounter table  
imageManual:image table
imagelinksManual:imagelinks table
interwikiManual:interwiki table
ipblocksManual:ipblocks table
  ipblocks_old  
  iwlinksManual:iwlinks table
  jobManual:job table
  l10n_cacheManual:l10n_cache table
1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19 1.20 1.21 1.22 1.23 1.24 1.25 1.26 1.27 1.28 master
  langlinksManual:langlinks table
linksManual:links table  
linksccManual:linkscc table  
  loggingManual:logging table
  log_searchManual:log_search table
mathManual:math table  
  module_depsManual:module_deps table
  msg_resourceManual:msg_resource table  
  msg_resource_linksManual:msg_resource_links table  
  objectcacheManual:objectcache table
1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19 1.20 1.21 1.22 1.23 1.24 1.25 1.26 1.27 1.28 master
oldManual:old table  
oldimageManual:oldimage table
  pageManual:page table
  pagelinksManual:pagelinks table
  page_propsManual:page_props table
  page_restrictionsManual:page_restrictions table
  protected_titlesManual:protected_titles table
  querycacheManual:querycache table
  querycachetwoManual:querycachetwo table
  querycache_info
1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19 1.20 1.21 1.22 1.23 1.24 1.25 1.26 1.27 1.28 master
  recentchanges
  redirect
  revision
searchindex
  sites
  site_identifiers
site_stats
  tag_summary
  templatelinks
  text
1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19 1.20 1.21 1.22 1.23 1.24 1.25 1.26 1.27 1.28 master
  trackbacks  
  transcache
  updatelog
  uploadstash
user
  user_former_groups
  user_groups
user_newtalk
  user_properties
  user_rights  
1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19 1.20 1.21 1.22 1.23 1.24 1.25 1.26 1.27 1.28 master
  valid_tag
  validate  
watchlist
1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19 1.20 1.21 1.22 1.23 1.24 1.25 1.26 1.27 1.28 master

Database management systems[edit]

See the latest MariaDB/MySQL-compatible version from Git: maintenance/tables.sql.

If using PostgreSQLManual:PostgreSQL, the file maintenance/postgres/tables.sql should be viewed instead.

If using Microsoft SQL Server, see maintenance/mssql/tables.sql.

If using Oracle, see maintenance/oracle/tables.sql.

See also[edit]

DatabasesManual:Database layout Engines: MySQL/MariaDBManual:MySQLOracleManual:OraclePostgreSQLManual:PostgreSQLSQLiteManual:SQLite
Technical documentation: SchemaManual:Database layout (tablesCategory:MediaWiki database tables) – API property associationsAPI:Database field and API property associationsField prefixesDatabase field prefixesPrimary key storage in other fieldsManual:Primary key storage in other fieldsWikimedia extension tablesCategory:Wikimedia extension database tables
Configuration: SettingsManual:Configuration_settings#Database_settingsSharingManual:Shared database
Development: AccessManual:Database accessOptimizationDatabase optimizationPolicyDevelopment policy#Database_patchesUpdaterManual:DatabaseUpdater.phpExtension schema updatesManual:Hooks/LoadExtensionSchemaUpdatesPatch fileManual:SQL patch file
Core tables: archivecategorycategorylinkschange_tagconfigexternallinksfilearchivehitcounterimageimagelinksinterwikiiwlinksipblocksjobl10n_cachelanglinkslogginglog_searchmsg_resourcemsg_resource_linksmodule_depsobjectcacheoldimagepagepagelinkspage_propspage_restrictionsprotected_titlesquerycachequerycachetwoquerycache_inforecentchangesredirectrevisionsearchindexsitessite_identifiers - site_statstag_summarytemplatelinkstexttranscacheupdateloguploadstashuseruser_former_groupsuser_groupsuser_newtalkuser_propertiestag_summaryvalid_tagwatchlist