pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bill MacArthur <webmaster@dhs-club.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #7626: Query planner never returns, uses 100% CPU
Date: Mon, 29 Oct 2012 13:08:56 -0400
Message-ID: <508EB828.4020600@dhs-club.com> (raw)
In-Reply-To: <E1TSsD5-00077c-4C@wrigleys.postgresql.org>
References: <E1TSsD5-00077c-4C@wrigleys.postgresql.org>

On 10/29/2012 12:29 PM, brian@omniti.com wrote:
> The following bug has been logged on the website:
>
> Bug reference:      7626
> Logged by:          Brian Dunavant
> Email address:      brian@omniti.com
> PostgreSQL version: 9.2.1
> Operating system:   MacOS + Others
> Description:
>
> Running this causes the thread to use 100% CPU and never returns (or at
> least not for longer than my patience runs out).
>
> This returns just fine on 8.4.1 and on 9.2beta.

This response is not an effort to assist you, Brian, but just to make an observation for the developers that my bug post earlier this month has an uncanny resemblence to this post. My post involved real data but was basically a mutltiple rejoin of a couple of tables on differing values. The total number of joins was almost exactly what you have here. In my case it worked fine on 9.0 but would never return in 9.2.1. Due to the complexity of building a self-contained test case, I ended up reworking the query into something simpler using CTE's. My bug reference was... scratch that, it was only a posting to pgsql-admin on Oct. 12, entitled "query from 9.0 fails to return on 9.2".

>
> CREATE TABLE foo (
>      id integer PRIMARY KEY
> );
>
> explain SELECT 1
> FROM foo AS a
> JOIN (SELECT 2 as aid) AS ag1 ON (ag1.aid=a.id)
> JOIN (SELECT 3 as aid) AS ag2 ON (ag2.aid=a.id)
> JOIN (SELECT 4 as aid) AS ag3 ON (ag3.aid=a.id)
> JOIN (SELECT 5 as aid) AS ag4 ON (ag4.aid=a.id)
> JOIN (SELECT 6 as aid) AS ag5 ON (ag5.aid=a.id)
> JOIN (SELECT 7 as aid) AS ag6 ON (ag6.aid=a.id)
> JOIN (SELECT 8 as aid) AS ag7 ON (ag7.aid=a.id)
> JOIN (SELECT 9 as aid) AS ag8 ON (ag8.aid=a.id)
> JOIN (SELECT 10 as aid) AS ag9 ON (ag9.aid=a.id)
> JOIN (SELECT 11 as aid) AS ag10 ON (ag10.aid=a.id)
> JOIN (SELECT 12 as aid) AS ag11 ON (ag11.aid=a.id)
> JOIN (SELECT 13 as aid) AS ag12 ON (ag12.aid=a.id)
> JOIN (SELECT 14 as aid) AS ag13 ON (ag13.aid=a.id)
> JOIN (SELECT 15 as aid) AS ag14 ON (ag14.aid=a.id)
> JOIN (SELECT 16 as aid) AS ag15 ON (ag15.aid=a.id)
> JOIN (SELECT 17 as aid) AS ag16 ON (ag16.aid=a.id)
> JOIN (SELECT 18 as aid) AS ag17 ON (ag17.aid=a.id)
> JOIN (SELECT 19 as aid) AS ag18 ON (ag18.aid=a.id)
> JOIN (SELECT 20 as aid) AS ag19 ON (ag19.aid=a.id)
> JOIN (SELECT 21 as aid) AS ag20 ON (ag20.aid=a.id)
> JOIN (SELECT 22 as aid) AS ag21 ON (ag21.aid=a.id)
> JOIN (SELECT 23 as aid) AS ag22 ON (ag22.aid=a.id)
> JOIN (SELECT 24 as aid) AS ag23 ON (ag23.aid=a.id)
> JOIN (SELECT 25 as aid) AS ag24 ON (ag24.aid=a.id)
> JOIN (SELECT 26 as aid) AS ag25 ON (ag25.aid=a.id)
> JOIN (SELECT 27 as aid) AS ag26 ON (ag26.aid=a.id)
> JOIN (SELECT 28 as aid) AS ag27 ON (ag27.aid=a.id)
> JOIN (SELECT 29 as aid) AS ag28 ON (ag28.aid=a.id)
> JOIN (SELECT 30 as aid) AS ag29 ON (ag29.aid=a.id)
> JOIN (SELECT 1 as aid) AS ag30 ON (ag30.aid=a.id)
> ;
>
>
>
>
>




view thread (3+ messages)  latest in thread

Message-ID: <508EB828.4020600@dhs-club.com>
Permalink:  ../508EB828.4020600@dhs-club.com/
Also on:    postgresql.org/message-id/508EB828.4020600@dhs-club.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: webmaster@dhs-club.com
  Subject: Re: BUG #7626: Query planner never returns, uses 100% CPU
  In-Reply-To: <508EB828.4020600@dhs-club.com>
  References: <E1TSsD5-00077c-4C@wrigleys.postgresql.org> <508EB828.4020600@dhs-club.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox