Re: Underestimated number of output rows with an aggregate function

2023-10-16 Thread Philippe BEAUDOIN
Le 15/10/2023 à 18:37, Tom Lane a écrit : Philippe BEAUDOIN writes: During my analysis, I realized that the output rows estimate of the second CTE is really bad, leading to a bad plan for the next CTE. I reproduced the issue in a very small test case with a simplified query. Attached is a shell

Re: Underestimated number of output rows with an aggregate function

2023-10-15 Thread Tom Lane
Philippe BEAUDOIN writes: > During my analysis, I realized that the output rows estimate of the > second CTE is really bad, leading to a bad plan for the next CTE. > I reproduced the issue in a very small test case with a simplified > query. Attached is a shell script and its output. Yeah. If