One more thing. Given this:
> The difference here is that, from the perspective of the outer query,
> the WHERE condition is a restriction clause on the "cim" relation,
> not a join clause. So it will get pushed down into the subquery
> without creating any join order constraints on the outer
Alex Reece writes:
> I managed to reduce my test case: the following query does not take
> advantage of the index on contribution metrics.
Yeah. What you're wishing is that the planner would push a join
condition down into a subquery, but it won't do that at present.
I managed to reduce my test case: the following query does not take
advantage of the index on contribution metrics.
explain select cim.yield
JOIN contributions on contributions.id = earnings.note_id
max(CASE metrics.name WHEN 'Yield'::text THEN
I'm on PostgreSQL 9.6.5 and getting an awkwardly bad plan chosen for my
I want to do:
select investments.id, cim.yield
JOIN investments ON contributions.investment_id = investments.id
JOIN contribution_investment_metrics_view cim ON cim.investment_id =