From: brian@omniti.com
To: pgsql-bugs@postgresql.org
Subject: BUG #7626: Query planner never returns, uses 100% CPU
Date: Mon, 29 Oct 2012 16:29:07 +0000
Message-ID: <E1TSsD5-00077c-4C@wrigleys.postgresql.org> (raw)
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.
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)
;
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: brian@omniti.com
Subject: Re: BUG #7626: Query planner never returns, uses 100% CPU
In-Reply-To: <E1TSsD5-00077c-4C@wrigleys.postgresql.org>
References: <E1TSsD5-00077c-4C@wrigleys.postgresql.org>
* 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