Re: Fighting the planner >:-(

From: Casey Allen Shobe <casey(at)shobe(dot)info>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Fighting the planner >:-(
Date: 2013-02-01 21:02:26
Message-ID: CAFmVg3ikX7VDtLxJD31jRKTGKS40qWO2zeNf06+3T3C2AjfC7g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)shobe(dot)info

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Виктор Егоров 2013-02-01 21:12:43 Re: Fighting the planner >:-(
Previous Message Casey Allen Shobe 2013-02-01 19:18:47 Re: Fighting the planner >:-(