Re: select taking forever

From: Steven Tower <tower(at)towerhome(dot)cx>
To: shridhar_daithankar(at)persistent(dot)co(dot)in
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: select taking forever
Date: 2003-08-29 11:37:55
Message-ID: 1062157075.9893.69.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I will give 7.4 a try. Actually I have played around with rewriting
this, it's not my select statement, personally I would have designed the
tables a little differently in order to facilitate better statements. I
agree, the IN's are a little much. :-)

Steven

On Fri, 2003-08-29 at 07:14, Shridhar Daithankar wrote:

> On 29 Aug 2003 at 7:04, Steven Tower wrote:
>
> >
> > I have a basic SQL call that takes forever because Postgresql seems to want to
> > use a Seq row scan on the table Products which has around 41k rows. Below is
> > the sql call and the explain.
> >
> > explain select * from ChargeCodes where AccountID = '{58C215AA-2C71-446F-88F3-
> > BC2C0D23EF28}' and ChargeCodeID IN (Select ChargeCodeID from Products where
> > ProductID in (select ProductID from OrderRules where WebUserRoleID
> > in (Select WebUserRoleID from WebUsers where WebUserID = '{3CD5D4F5-
> > 448B-11D5-83DB-0001023EA2FA}')))
>
> So many in's nested? I doubt a 7.3.x would survive that.
>
> Upgrade to 7.4 beta2. The 'in' problem is taken care of, in there..
>
> Can you somehow rewrite that as nested joins? They could be much better..
>
> Bye
> Shridhar
>
> --
> There comes to all races an ultimate crisis which you have yet to face.... One day our minds became so powerful we dared think of ourselves as gods. -- Sargon, "Return to Tomorrow", stardate 4768.3
>
>
> ---------------------------(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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sander Smeenk 2003-08-29 11:56:14 Re: PostgreSQL upgrade -> fails to start server
Previous Message Martijn van Oosterhout 2003-08-29 11:27:30 Re: PostgreSQL upgrade -> fails to start server