Re: Slow recursive CTE query questions, with row estimate and n_distinct issues

2020-12-29 Thread Christopher Baines
Michael Lewis writes: > On Mon, Dec 28, 2020 at 7:51 AM Christopher Baines wrote: > >> derivation_inputs: >> COUNT(*): 285422539 >> reltuples: 285422528 >> >> derivation_id: >> COUNT(DISTINCT): 7508610 >> n_distinct: 4336644 (~57% of the true value) >> >> derivation_output

Re: Slow recursive CTE query questions, with row estimate and n_distinct issues

2020-12-29 Thread Christopher Baines
Greg Spiegelberg writes: > On Mon, Dec 28, 2020 at 7:51 AM Christopher Baines wrote: > >> Hi, >> >> I have a performance problem with a query. I've uploaded it, along with >> the EXPLAIN ANALYZE output here [1]. >> >> 1: https://explain.depesz.com/s/w5vP >> >> I think the query is taking longer