Re: Fighting the planner >:-( - Mailing list pgsql-performance

From Casey Allen Shobe
Subject Re: Fighting the planner >:-(
Date
Msg-id CAFmVg3ikX7VDtLxJD31jRKTGKS40qWO2zeNf06+3T3C2AjfC7g@mail.gmail.com
Whole thread Raw
In response to Re: Fighting the planner >:-(  (Casey Allen Shobe <casey@shobe.info>)
Responses Re: Fighting the planner >:-(  (Виктор Егоров <vyegorov@gmail.com>)
List pgsql-performance
Rhodiumtoad on IRC helped me figure out how to move part of the query into a CTE in order to work around the planner problem.  This is a hack but it brings the time down from many hours to 17 seconds, which is better than it was even with the better plan in the first place!  For some reason it actually gets 2 seconds faster yet by putting it in a SQL function rather than using prepare/execute.

Hopefully some improvements to the planner can come from this information?

Here is the CTE version of the query:  http://pgsql.privatepaste.com/2f7fd3f669
...and  here is it's explain analyze:  http://explain.depesz.com/s/5ml

--
Casey Allen Shobe
casey@shobe.info


pgsql-performance by date:

Previous
From: Casey Allen Shobe
Date:
Subject: Re: Fighting the planner >:-(
Next
From: Виктор Егоров
Date:
Subject: Re: Fighting the planner >:-(