Re: Huge query stalls at PARSE/BIND stage (1) - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Huge query stalls at PARSE/BIND stage (1)
Date
Msg-id 29674.1132252039@sss.pgh.pa.us
Whole thread Raw
In response to Huge query stalls at PARSE/BIND stage (1)  (Matt <msubs@philips.org.uk>)
List pgsql-bugs
Matt <msubs@philips.org.uk> writes:
> Yesterday I added 20 more join statements to the query (identical to
> existing statements) and now the main query which would run in <30
> seconds, runs indefinitely with the process stuck at "PARSE" in version
> 7.4, or "BIND" in version 8.0.3.

You *really* need to rethink your database design :-( ... thirty-way
JOINs are just not a very good idea.

Having said that, though, the fact that they're all outer joins should
save you from an exponential blowup in planning time, because there's
only one legal join order.  I'm not sure where the time is going.

If you'd be willing to send me a test case off-list, I'd be willing to
take a look.  A convenient test case from my point of view would be a
SQL script that sets up the database plus another one containing the
slow query.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Mikael Carneholm"
Date:
Subject: Re: Autovacuum deadlock - bug or not?
Next
From: "David Fetter"
Date:
Subject: BUG #2051: CREATE TEMP TABLE AS SELECT doesn't play nice with ON COMMIT DROP