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
..
2022-10-05 10:44:38 -07:00
2024-10-09 17:14:42 +09:00
2022-02-08 15:30:38 -05:00
2023-10-20 12:28:46 -04:00
2024-10-05 14:46:44 -04:00
2024-07-23 21:59:02 -05:00
2024-04-06 21:56:23 -05:00
2024-01-31 15:02:28 +09:00
2023-02-28 08:04:13 +09:00
2024-01-02 12:05:41 -05:00
2024-09-30 08:43:28 +09:00
2024-09-30 08:43:28 +09:00
2021-04-02 11:01:49 +02:00
2023-02-28 08:04:13 +09:00
2024-03-13 14:49:26 -05:00
2024-05-21 12:44:51 -04:00
2023-06-07 16:57:06 +02:00
2024-03-13 23:33:44 -07:00
2024-07-30 00:58:06 -07:00
2023-12-29 11:26:10 -08:00
2024-05-03 11:10:40 +02:00
2024-07-12 13:44:19 +02:00
2022-02-08 15:30:38 -05:00
2024-10-08 18:19:58 +09:00
2024-10-01 16:53:54 -04:00
2022-04-04 20:00:33 +02:00
2024-04-02 13:10:16 +02:00
2022-10-17 14:02:05 -04:00
2022-02-08 15:40:08 -05:00
2022-08-10 13:37:25 -04:00
2021-11-17 16:54:12 -05:00
2024-09-21 15:17:46 -05:00
2022-02-08 15:30:38 -05:00
2023-10-20 12:28:46 -04:00
2024-06-06 15:16:56 -04:00
2024-01-29 08:05:59 +09:00
2023-04-28 19:29:12 +09:00
2024-05-22 17:54:17 -04:00
2024-10-03 10:55:02 +09:00
2022-12-09 10:08:44 -05:00
2024-08-29 13:24:17 -04:00
2024-06-27 19:21:05 -07:00
2023-02-28 08:04:13 +09:00
2024-07-28 22:22:52 +12:00
2024-03-13 14:49:26 -05:00
2024-04-15 08:34:45 +02:00
2024-03-24 14:30:29 -04:00
2024-09-04 12:17:11 +09:00
2022-02-08 15:30:38 -05:00
2024-01-17 23:16:53 +02:00
2023-12-07 08:31:02 +09:00
2024-09-17 14:38:53 +09:00
2023-05-17 10:19:17 +09:00
2023-11-16 10:05:14 -05:00
2023-02-28 08:04:13 +09:00
2023-03-14 09:17:36 +00:00
2024-03-26 15:28:31 -04:00
2024-08-08 19:35:13 -04:00
2024-08-29 12:24:47 +02:00
2023-02-28 08:04:13 +09:00
2022-09-25 13:10:17 -04:00
2022-09-25 13:10:17 -04:00
2024-10-09 17:19:04 +09:00
2024-10-01 08:56:21 +09:00
2024-01-15 09:30:16 +09:00
2023-12-01 10:22:13 +05:30
2023-09-06 10:18:30 +02:00
2024-09-10 14:48:13 -04:00
2024-09-17 15:53:35 -04:00
2024-10-09 17:14:42 +09:00
2024-05-15 14:31:47 +09:00
2024-09-26 15:51:23 -05:00
2022-02-08 15:30:38 -05:00
2023-02-28 08:04:13 +09:00
2024-05-13 11:31:09 +02:00
2024-06-11 17:57:46 -04:00
2024-03-14 14:57:16 -04:00
2023-02-28 08:04:13 +09:00
2023-02-28 08:04:13 +09:00
2024-09-26 11:02:31 -04:00
2024-08-16 12:35:53 -04:00
2023-06-20 17:47:53 -04:00
2024-09-27 16:04:04 -04:00
2023-02-28 08:04:13 +09:00
2024-09-11 13:21:10 +02:00
2024-09-12 14:30:29 -04:00
2024-08-16 11:24:44 -05:00
2024-01-25 10:15:43 -05:00
2023-12-15 13:55:05 -05:00
2021-10-01 18:29:18 -03:00
2023-02-28 08:04:13 +09:00
2022-03-22 10:28:10 +00:00
2023-02-28 08:04:13 +09:00
2023-02-28 08:04:13 +09:00
2023-02-28 08:04:13 +09:00
2024-03-04 17:31:38 -08:00
2022-10-13 12:02:31 +02:00
2024-08-30 12:22:31 -04:00
2024-10-03 13:48:32 +01:00
2024-09-17 11:29:29 +02:00
2024-09-21 15:17:46 -05:00
2022-02-08 15:30:38 -05:00
2024-07-19 11:52:32 -05:00
2024-02-14 11:30:39 -05:00
2022-08-25 10:31:20 +02:00
2024-03-04 17:31:38 -08:00
2022-10-20 10:10:17 +01:00
2024-10-04 09:49:24 +01:00
2024-07-02 09:29:26 +02:00
2022-11-18 16:00:52 +01:00
2023-02-28 08:04:13 +09:00
2023-11-22 09:32:06 +09:00
2022-09-05 00:09:17 +02:00
2024-07-30 15:51:54 +09:00
2024-07-05 14:05:08 +12:00
2024-10-07 10:56:16 -05:00
2023-02-28 08:04:13 +09:00
2023-02-28 08:04:13 +09:00
2024-04-10 15:45:58 -04:00
2023-02-28 08:04:13 +09:00
2023-02-28 08:04:13 +09:00
2021-07-27 15:01:49 -04:00
2022-04-16 16:04:50 -04:00
2024-04-12 20:07:53 +12:00
2024-07-02 10:43:12 +02:00
2024-04-29 21:10:41 +09:00
2024-09-12 21:51:26 +09:00
2024-09-20 08:59:20 +09:00
2024-08-15 13:10:25 +12:00
2024-03-27 10:12:39 +00:00
2024-04-15 12:56:56 -04:00
2024-01-20 13:57:54 -05:00
2021-08-24 16:37:26 -04:00
2024-03-20 17:11:28 -04:00
2023-12-08 11:58:58 +01:00
2024-05-13 11:31:09 +02:00
2024-05-07 13:35:10 -04:00
2024-08-09 11:21:39 -04:00
2024-03-30 10:00:26 +00:00
2024-02-28 15:17:23 +04:00
2022-10-28 23:04:38 +13:00
2024-01-31 17:22:02 +13:00
2022-02-08 15:30:38 -05:00
2024-09-17 19:53:11 -07:00
2022-05-09 14:15:37 -04:00
2024-08-30 08:49:24 +09:00
2022-09-25 13:10:17 -04:00
2024-09-06 13:25:53 +09:00
2024-09-12 09:39:56 +09:00
2024-09-11 13:21:10 +02:00
2024-05-06 09:00:00 -05:00
2024-09-18 12:44:15 +09:00
2024-08-12 10:35:06 -05:00
2024-07-24 10:13:36 +05:30
2024-08-30 12:42:12 -04:00
2024-08-12 15:42:16 +12:00
2021-09-10 13:18:32 -04:00
2024-09-21 15:17:46 -05:00
2023-10-16 14:06:14 -04:00
2024-02-28 14:34:19 -05:00
2022-02-08 15:30:38 -05:00
2023-02-28 08:04:13 +09:00
2023-02-28 08:04:13 +09:00
2024-08-15 15:47:31 -05:00
2024-09-14 17:55:02 -04:00
2023-10-17 13:10:35 -04:00
2023-09-21 23:11:30 -04:00
2024-06-20 14:21:36 -04:00
2024-04-18 21:28:07 +02:00
2024-06-13 20:35:02 -04:00
2023-02-28 08:04:13 +09:00
2024-04-16 16:21:31 +12:00
2023-11-12 10:06:51 +09:00
2024-07-26 12:39:45 -04:00
2023-11-01 22:47:06 -07:00
2024-05-21 12:54:09 -04:00
2024-07-20 13:40:15 -04:00
2024-01-20 17:54:14 -05:00
2024-03-19 09:32:04 +01:00
2021-11-02 12:06:17 -07:00
2024-09-24 18:03:40 +12:00
2023-02-28 08:04:13 +09:00
2024-05-05 12:54:46 +12:00
2024-07-14 13:49:46 -04:00
2024-09-17 11:29:30 +02:00
2023-02-28 08:04:13 +09:00
2024-09-10 16:20:31 -04:00
2022-03-18 16:01:42 -04:00