1
0
mirror of https://github.com/postgres/postgres.git synced 2026-01-05 23:38:41 +03:00
Files
postgres/src/test/regress/sql
Richard Guo 67a54b9e83 Allow pushdown of HAVING clauses with grouping sets
In some cases, we may want to transfer a HAVING clause into WHERE in
hopes of eliminating tuples before aggregation instead of after.

Previously, we couldn't do this if there were any nonempty grouping
sets, because we didn't have a way to tell if the HAVING clause
referenced any columns that were nullable by the grouping sets, and
moving such a clause into WHERE could potentially change the results.

Now, with expressions marked nullable by grouping sets with the RT
index of the RTE_GROUP RTE, it is much easier to identify those
clauses that reference any nullable-by-grouping-sets columns: we just
need to check if the RT index of the RTE_GROUP RTE is present in the
clause.  For other HAVING clauses, they can be safely pushed down.

Author: Richard Guo
Discussion: https://postgr.es/m/CAMbWs4-NpzPgtKU=hgnvyn+J-GanxQCjrUi7piNzZ=upiCV=2Q@mail.gmail.com
2024-10-09 17:19:04 +09:00
..
2024-01-31 15:02:28 +09:00
2024-07-12 13:44:19 +02:00
2024-04-15 08:34:45 +02:00
2024-07-19 11:52:32 -05:00
2022-08-25 10:31:20 +02:00
2024-10-07 10:56:16 -05:00
2024-07-02 10:43:12 +02:00
2024-02-28 15:17:23 +04:00
2024-08-12 10:35:06 -05:00
2024-09-21 15:17:46 -05:00
2024-04-18 21:28:07 +02:00
2024-04-16 16:21:31 +12:00
2024-03-19 09:32:04 +01:00