Re: Slow query fixed by replacing equality with a nested query

From: Michael Lewis <mlewis(at)entrata(dot)com>
To: Valentin Janeiko <val(dot)janeiko(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Slow query fixed by replacing equality with a nested query
Date: 2022-01-21 03:33:17
Message-ID: CAHOFxGoOz4RYH2Zj9C6EqcqLKKTwv=76onrOK0_DJGC8Fhu8vQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

I don't see any reference to cte1. Is that expected?

I'm unclear why these sets are not just inner join'd
on resource_surrogate_id. It seems like that column it is being selected as
Sid1 in each CTE, and then the next one does the below. Why?

where resource_surrogate_id IN (SELECT Sid1 FROM cte_previous_number)

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message val.janeiko 2022-01-21 11:37:54 RE: Slow query fixed by replacing equality with a nested query
Previous Message David G. Johnston 2022-01-20 23:27:23 Re: PostgreSQL and Linux CPU's