Per discussion on Mediawiki-l, talk about the GROUP BY issue a bit.
authorGreg Sabino Mullane <greg@users.mediawiki.org>
Fri, 29 Apr 2011 13:42:48 +0000 (13:42 +0000)
committerGreg Sabino Mullane <greg@users.mediawiki.org>
Fri, 29 Apr 2011 13:42:48 +0000 (13:42 +0000)
docs/database.txt
docs/databases/postgres.txt

index b9fa6ff..3985b70 100644 (file)
@@ -186,3 +186,14 @@ MediaWiki does support the following other DBMSs to varying degrees.
 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.
+
index cec5186..6b266a6 100644 (file)
@@ -92,6 +92,18 @@ in maintenance/tables.sql itself, as it is very strict in the
 format it expects things to be in. :)
 
 
+== MySQL differences ==
+
+The major differences between MySQL and Postgres are represented as 
+methods in the Database class. For example, implicitGroupby() is 
+true for MySQL and false for Postgres. This means that in those 
+places where the code does not add all the non-aggregate items 
+from the SELECT clause to the GROUP BY, we can add them in, but in 
+a conditional manner with the above method, as simply adding them 
+all in to the main query may cause performance problems with 
+MySQL.
+
+
 == Getting help ==
 
 In addition to the normal venues (MediaWiki mailing lists