And, probably, next query belongs to same issue:
SELECT
--next_ots.group_cost AS next_cost,
(SELECT next_ots FROM order_total_suma( next_range ) next_ots
WHERE next_ots.order_id = ots.order_id AND next_ots.consumed_period @>
(ots.o).billed_to
) AS next_suma, -- << this takes 111ms only
ots.* F
Hello
to my mind I may be done, because `id` is primary key of `o` table
Friday, July 12, 2019, 1:04:27 PM, you wrote:
> Hello PostgreSQL-development,
> something's stopping the planner from being able to deduce that
> (t.o).id is safe to push through a GROUP BY ocd.o
> SELECT * FROM (
Hello PostgreSQL-development,
something's stopping the planner from being able to deduce that (t.o).id is
safe to push through a GROUP BY ocd.o
SELECT * FROM (
SELECT
sum( t.group_suma ) OVER( PARTITION BY t.id )
AS total_suma,
--