Subject | RE: [ib-support] how to perform update with aggregate subselect ? |
---|---|
Author | Louis Kleiman |
Post date | 2002-06-19T13:13:14Z |
In my apps, IDs like this are always integers > 0. I often have to add
what I call hints to queries like this that dont want to use the
primary key without a little nudging:
update table1
set total = (select sum(Quantity) from table2 where table2.CustomerID
= table1.CustomerID and table2.CustomerID > 0)
Maybe it works in your case, maybe not
Louis Kleiman
SSTMS, Inc.
-----Original Message-----
From: Andrew Guts [mailto:andr@...]
Sent: Wednesday, June 19, 2002 8:53 AM
To: ib-support@yahoogroups.com
Subject: Re: [ib-support] how to perform update with aggregate subselect
?
Martijn Tonies wrote:
PLAN (T1 NATURAL)
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
what I call hints to queries like this that dont want to use the
primary key without a little nudging:
update table1
set total = (select sum(Quantity) from table2 where table2.CustomerID
= table1.CustomerID and table2.CustomerID > 0)
Maybe it works in your case, maybe not
Louis Kleiman
SSTMS, Inc.
-----Original Message-----
From: Andrew Guts [mailto:andr@...]
Sent: Wednesday, June 19, 2002 8:53 AM
To: ib-support@yahoogroups.com
Subject: Re: [ib-support] how to perform update with aggregate subselect
?
Martijn Tonies wrote:
>Hi,table2.CustomerID
>
>
>
>>Help me please with this:
>>
>>update table1
>> set total = (select sum(Quantity) from table2 where
>>= table1.CustomerID)PLAN (T2 NATURAL)
>>
>>CustomerID is a foreign key for both tables, references to the same
>>table "Customers".
>>That operator hangs because table2 is large and engine uses natural
>>joins. How to work arround the problem?
>>
>>
>
>What is the query plan?
>
>
>
PLAN (T1 NATURAL)
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.