postgresql/src/include
Tom Lane d4c3a156cb Remove GROUP BY columns that are functionally dependent on other columns.
If a GROUP BY clause includes all columns of a non-deferred primary key,
as well as other columns of the same relation, those other columns are
redundant and can be dropped from the grouping; the pkey is enough to
ensure that each row of the table corresponds to a separate group.
Getting rid of the excess columns will reduce the cost of the sorting or
hashing needed to implement GROUP BY, and can indeed remove the need for
a sort step altogether.

This seems worth testing for since many query authors are not aware of
the GROUP-BY-primary-key exception to the rule about queries not being
allowed to reference non-grouped-by columns in their targetlists or
HAVING clauses.  Thus, redundant GROUP BY items are not uncommon.  Also,
we can make the test pretty cheap in most queries where it won't help
by not looking up a rel's primary key until we've found that at least
two of its columns are in GROUP BY.

David Rowley, reviewed by Julien Rouhaud
2016-02-11 17:34:59 -05:00
..
access Make all built-in lwlock tranche IDs fixed. 2016-02-02 06:45:55 -05:00
bootstrap Update copyright for 2016 2016-01-02 13:33:40 -05:00
catalog Remove GROUP BY columns that are functionally dependent on other columns. 2016-02-11 17:34:59 -05:00
commands Update copyright for 2016 2016-01-02 13:33:40 -05:00
common Update copyright for 2016 2016-01-02 13:33:40 -05:00
datatype Update copyright for 2016 2016-01-02 13:33:40 -05:00
executor Allow parallel custom and foreign scans. 2016-02-03 12:49:46 -05:00
foreign Add some additional core functions to support join pushdown for FDWs. 2016-02-04 17:05:09 -05:00
lib Add two HyperLogLog functions 2016-01-19 17:40:15 -03:00
libpq Update copyright for 2016 2016-01-02 13:33:40 -05:00
mb Update copyright for 2016 2016-01-02 13:33:40 -05:00
nodes Introduce a new GUC force_parallel_mode for testing purposes. 2016-02-07 11:41:33 -05:00
optimizer Introduce a new GUC force_parallel_mode for testing purposes. 2016-02-07 11:41:33 -05:00
parser Support multi-stage aggregation. 2016-01-20 13:46:50 -05:00
port Fix minor typo in comment 2016-01-15 10:24:37 +01:00
portability Update copyright for 2016 2016-01-02 13:33:40 -05:00
postmaster Update copyright for 2016 2016-01-02 13:33:40 -05:00
regex Fix some regex issues with out-of-range characters and large char ranges. 2016-02-08 10:25:40 -05:00
replication Migrate replication slot I/O locks into a separate tranche. 2016-01-29 09:45:38 -05:00
rewrite Update copyright for 2016 2016-01-02 13:33:40 -05:00
snowball Update copyright for 2016 2016-01-02 13:33:40 -05:00
storage Use separate lwlock tranches for buffer, lock, and predicate lock managers. 2016-02-11 14:07:33 -05:00
tcop Update copyright for 2016 2016-01-02 13:33:40 -05:00
tsearch Update copyright for 2016 2016-01-02 13:33:40 -05:00
utils Improve speed of timestamp/time/date output functions. 2016-02-06 23:11:28 -05:00
.gitignore Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
c.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
fmgr.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
funcapi.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
getaddrinfo.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
getopt_long.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
Makefile Install lwlocknames.h even in vpath builds. 2015-09-11 16:45:41 -04:00
miscadmin.h Revert "Temporarily make pg_ctl and server shutdown a whole lot chattier." 2016-02-10 16:01:04 -05:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.win32 Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h Change the way that LWLocks for extensions are allocated. 2016-02-04 16:43:04 -05:00
pg_config.h.in Add support for systemd service notifications 2016-02-02 21:04:29 -05:00
pg_config.h.win32 Add BSWAP64 macro. 2015-10-08 13:01:36 -04:00
pg_getopt.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_trace.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pgstat.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pgtar.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pgtime.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
port.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
postgres_ext.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00
postgres_fe.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
postgres.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
rusagestub.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
windowapi.h Update copyright for 2016 2016-01-02 13:33:40 -05:00