Skip site navigation (1) Skip section navigation (2)

Re: Weird plan variation with recursive CTEs

From: Claudio Freire <klaussfreire(at)gmail(dot)com>
To: postgres performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Weird plan variation with recursive CTEs
Date: 2012-04-26 18:23:09
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
On Thu, Apr 26, 2012 at 2:37 PM, Claudio Freire <klaussfreire(at)gmail(dot)com> wrote:
> Fun thing is, nothing in the CTE's execution really changed. The only
> change, is that now a sequential scan of overview was chosen instead
> of the index.
> Why could this be? The output (number of search values, even the
> values themselves and their order) is the same between both plans.

I just noticed it's misestimating the output of the union distinct,
but not of the select distinct.

One would expect the estimation procedure to be the same in both cases.
Any reason for the difference? Any way to "teach" pg about it?

In response to


pgsql-performance by date

Next:From: Kevin GrittnerDate: 2012-04-26 18:23:38
Subject: Re: query optimization
Previous:From: Claudio FreireDate: 2012-04-26 17:37:54
Subject: Weird plan variation with recursive CTEs

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group