Re: Slow query and wrong row estimates for CTE

2021-02-15 Thread Justin Pryzby
On Mon, Feb 15, 2021 at 12:49:29PM -0500, Dane Foster wrote: > PostgreSQL version: PostgreSQL 12.5 on x86_64-pc-linux-gnu, compiled by gcc > (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11), 64-bit > EXPLAIN (ANALYZE, BUFFERS) > WITH max_spi AS ( Since v12, CTEs are usually inlined by default. I suspect i

Slow query and wrong row estimates for CTE

2021-02-15 Thread Dane Foster
Hello, I'm seeking guidance in how to improve the performance of a slow query and to have some other sets of eyes confirm that what I wrote does what I intend. According to the PostgreSQL wiki there is a set of metadata that I should provide to help you help me. So let's begin there. PostgreSQL