BUG #7626: Query planner never returns, uses 100% CPU

From: brian(at)omniti(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #7626: Query planner never returns, uses 100% CPU
Date: 2012-10-29 16:29:07
Message-ID: E1TSsD5-00077c-4C@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 7626
Logged by: Brian Dunavant
Email address: brian(at)omniti(dot)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.

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)
;

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bill MacArthur 2012-10-29 17:08:56 Re: BUG #7626: Query planner never returns, uses 100% CPU
Previous Message Alvaro Herrera 2012-10-29 14:19:21 Re: BUG #6704: ALTER EXTENSION postgis SET SCHEMA leaves dangling relations