Re: Optimizer generates bad plans.

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Optimizer generates bad plans.
Date: 2002-09-19 22:40:17
Message-ID: 1032475223.51463.5.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)candle(dot)pha(dot)pa(dot)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(at)postgresql(dot)org)
> >
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>
--
Rod Taylor

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Conway 2002-09-19 22:43:27 Re: Optimizer generates bad plans.
Previous Message Tom Lane 2002-09-19 22:34:27 Re: Optimizer generates bad plans.