HomePhabricator

PostgreSQL: Fix ORDER BY NULL
bef72ac72205Unpublished

Unpublished Commit · Learn More

Repository Importing: This repository is still importing.

Description

PostgreSQL: Fix ORDER BY NULL

MySQL automatically orders by the GROUP BY columns if no ORDER BY
is specified. You can countermand this by specifying
ORDER BY NULL, which can give speed improvements in some cases,
for example if the GROUP BY was implemented by hashing then a
sort is unneeded and wastes time.

PostgreSQL does not tolerate the ORDER BY NULL syntax,
and does not need an analgous hint because it never does
gratuitious sorting of the nature just discussed.

This patch makes PostgreSQL ignore the ORDER BY NULL clause.

It might be a better approach to find a way to add this clause
specifically to MySQL, rather than to drop it specifically from
other database engines.

SQLite seems to tolerate the MySQL syntax. Oracle and MSSQL
were not evaluated.

Bug: 67594
Change-Id: Ia9666136edd25e1e0d0728a8b28a92e44d00abc6
(cherry picked from commit ae811ddb6cc4932291cf73ce7768789eb39a33fd)

Details

Provenance
JjanesAuthored on
Parents
rMW04feb7f68d3a: Fix initSiteStats.php maintenance script
Branches
Unknown
Tags
Unknown
ChangeId
Ia9666136edd25e1e0d0728a8b28a92e44d00abc6