Re: Optimizer generates bad plans. - Mailing list pgsql-hackers

From Rod Taylor
Subject Re: Optimizer generates bad plans.
Date
Msg-id 1032475223.51463.5.camel@jester
Whole thread Raw
In response to Re: Optimizer generates bad plans.  (Kris Jurka <books@ejurka.com>)
List pgsql-hackers
Maybe not nice, but there's only 32 (64 now?) of them...

JOIN pg_attribute WHERE attnum IN (conkeys[1], conkeys[2], conkeys[3],
..., conkeys[32])

Great fun...

On Thu, 2002-09-19 at 18:31, Kris Jurka wrote:
> 
> Well I was really hoping pg_constraint would solve all my problems, but
> since contrib/array is not installed by default the conkeys and confkeys
> columns aren't terribly useful because they can't be joined to
> pg_attribute.
> 
> Also there is not a column to tell you the unique constraint that
> supports a given foreign key constraint.
> 
> See my post to bugs:
> 
> http://fts.postgresql.org/db/mw/msg.html?mid=1074855
> 
> Kris Jurka
> 
> 
> On Thu, 19 Sep 2002, Bruce Momjian wrote:
> 
> >
> > Congratulations.  That is the largest plan I have ever seen.  ;-)
> >
> > ---------------------------------------------------------------------------
> >
> > Kris Jurka wrote:
> > > While adding schema support to the JDBC Driver, I came across a query
> > > which occasionally generates some spectacularly bad plans.  I have
> > > attached the query and explain analyze outputs against today's cvs head
> > > for queries that take between 9 and 845941 msec.  In the JDBC Driver I
> > > will specify a reasonable join order using explicit JOINs, but I thought
> > > someone might be interested in a test case for the optimizer.
> >
> > --
> >   Bruce Momjian                        |  http://candle.pha.pa.us
> >   pgman@candle.pha.pa.us               |  (610) 359-1001
> >   +  If your life is a hard drive,     |  13 Roberts Road
> >   +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 2: you can get off all lists at once with the unregister command
> >     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> >
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
> 
--  Rod Taylor



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Optimizer generates bad plans.
Next
From: Neil Conway
Date:
Subject: Re: Optimizer generates bad plans.