Re: [PERFORM] slow query plans caused by under-estimation of CTE cardinality

2013-02-18 Thread John Lumby
Vitalii wrote > > Since cte is already an optimization fence, you can go further and make > it temporary table. > Create table;analyze;select should make optimizer's work much easier. > Thanks Vitalii  -  yes,   you are right,  and I have used that technique on other cases like this. How

[PERFORM] slow query plans caused by under-estimation of CTE cardinality

2013-02-18 Thread John Lumby
On 2012-10-09 23:09:21 Tom Lane wrote: > > re subject Why am I getting great/terrible estimates with these CTE queries? > You're assuming the case where the estimate is better is better for a > reason ... but it's only better as a result of blind dumb luck.  The > outer-level query planner do