Programming, Sql, Postgresql, Performance, Data Engineering.
with JOINs and the subquery itself, independently fast, but dramatically slow when combined? Move the sub-query into a CTE: If the query is fast on its own, then we can just pre-compute the fast result and then supply that to the main query WITH matching_urls AS ( select id::text from