From: Greg Sabino Mullane Date: Fri, 29 Apr 2011 13:42:48 +0000 (+0000) Subject: Per discussion on Mediawiki-l, talk about the GROUP BY issue a bit. X-Git-Tag: 1.31.0-rc.0~30517 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=c9f12ba55331f76de13057c0d105de0d884c67cb;p=lhc%2Fweb%2Fwiklou.git Per discussion on Mediawiki-l, talk about the GROUP BY issue a bit. --- diff --git a/docs/database.txt b/docs/database.txt index b9fa6ff711..3985b70e07 100644 --- a/docs/database.txt +++ b/docs/database.txt @@ -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. + diff --git a/docs/databases/postgres.txt b/docs/databases/postgres.txt index cec518619d..6b266a6a77 100644 --- a/docs/databases/postgres.txt +++ b/docs/databases/postgres.txt @@ -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