Implement autocompletion for Performer field on Special:Log
[lhc/web/wiklou.git] / docs / database.txt
index e893b41..735f26b 100644 (file)
@@ -7,8 +7,8 @@ By Tim Starling, January 2006.
 
 For information about the MediaWiki database layout, such as a 
 description of the tables and their contents, please see:
-  http://www.mediawiki.org/wiki/Manual:Database_layout
-  http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/maintenance/tables.sql?view=markup
+  https://www.mediawiki.org/wiki/Manual:Database_layout
+  https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blob_plain;f=maintenance/tables.sql;hb=HEAD
 
 
 ------------------------------------------------------------------------
@@ -23,8 +23,6 @@ foreach ( $res as $row ) {
        ...
 }
 
-Note the assignment operator in the while condition.
-
 For a write query, use something like:
 
 $dbw = wfGetDB( DB_MASTER );
@@ -148,18 +146,16 @@ to avoid long-lasting locks. By default, MediaWiki opens a transaction
 at the first query, and commits it before the output is sent. Locks will
 be held from the time when the query is done until the commit. So you
 can reduce lock time by doing as much processing as possible before you
-do your write queries. Update operations which do not require database
-access can be delayed until after the commit by adding an object to
-$wgPostCommitUpdateList.
+do your write queries.
 
 Often this approach is not good enough, and it becomes necessary to
 enclose small groups of queries in their own transaction. Use the
 following syntax:
 
 $dbw = wfGetDB( DB_MASTER );
-$dbw->begin();
+$dbw->begin( __METHOD__ );
 /* Do queries */
-$dbw->commit();
+$dbw->commit( __METHOD__ );
 
 Use of locking reads (e.g. the FOR UPDATE clause) is not advised. They
 are poorly implemented in InnoDB and will cause regular deadlock errors.
@@ -173,3 +169,30 @@ queries, by using an appropriate condition in the WHERE clause of an
 UPDATE, or by using unique indexes in combination with INSERT IGNORE.
 Then use the affected row count to see if the query succeeded.
 
+------------------------------------------------------------------------
+    Supported DBMSs
+------------------------------------------------------------------------
+
+MediaWiki is written primarily for use with MySQL. Queries are optimized
+for it and its schema is considered the canonical version. However,
+MediaWiki does support the following other DBMSs to varying degrees.
+
+* PostgreSQL
+* SQLite
+* Oracle
+* MSSQL
+
+More information can be found about each of these databases (known issues,
+level of support, extra configuration) in the "databases" subdirectory in
+this folder.
+
+------------------------------------------------------------------------
+    Use of GROUP BY
+------------------------------------------------------------------------
+
+MySQL supports GROUP BY without checking anything in the SELECT clause. 
+Other DBMSs (especially Postgres) are stricter and require that all the 
+non-aggregate items in the SELECT clause appear in the GROUP BY. For 
+this reason, it is highly discouraged to use SELECT * with GROUP BY 
+queries.
+