On 11/17/2015 02:44 PM, Jayadevan M wrote:
> I would say it is normal. Please read this for explanation :
> http://blog.2ndquadrant.com/postgresql-ctes-are-optimization-fences/
Thanks for the link, now I also recall, that I already read about this
in section 7.8. of docs.
I turns out that in second query I am kind of abused CTE by something
that looks like side-effect. Not sure about how code with this "unneeded
CTE-ism" will be perceived by others. But definitely it is better to
have such option than not to.
In my case, actually, performance of both queries totally meet
requirements so I keep the "normal" query.
Thanks.