Subject | RE: [ib-support] Question on delete |
---|---|
Author | Louis Kleiman |
Post date | 2003-03-20T15:48Z |
I have used techniques like adding other WHERE phrases to solve this type of
problem in the past. In you situation, assuming all the ID values are > 0,
I would write the query as follows:
delete from mytable
where (mytable.id > 0)
and (mytable.id in ( select id from listtable where <search condition> ))
HTH
Louis Kleiman
SSTMS, Inc.
-----Original Message-----
From: Paolo Fainelli [mailto:paolo@...]
Sent: Thursday, March 20, 2003 10:37 AM
To: ib-support@yahoogroups.com
Subject: [ib-support] Question on delete
I have a query like this:
delete from mytable where mytable.id in ( select id from listtable where
<search condition> )
Usually this query delete only few record from a large table. It works, but
slowly, because FB doesn't use the index on mytable.id.
How can I spedd up this query ?
Thanks in advance
Paolo
Yahoo! Groups Sponsor
<http://rd.yahoo.com/M=245314.3072841.4397732.2848452/D=egroupweb/S=17051153
86:HM/A=1495890/R=0/*http:/www.netbizideas.com/yheb42%20>
<http://us.adserver.yahoo.com/l?M=245314.3072841.4397732.2848452/D=egroupmai
l/S=:HM/A=1495890/rand=336369566>
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to the Yahoo!
<http://docs.yahoo.com/info/terms/> Terms of Service.
[Non-text portions of this message have been removed]
problem in the past. In you situation, assuming all the ID values are > 0,
I would write the query as follows:
delete from mytable
where (mytable.id > 0)
and (mytable.id in ( select id from listtable where <search condition> ))
HTH
Louis Kleiman
SSTMS, Inc.
-----Original Message-----
From: Paolo Fainelli [mailto:paolo@...]
Sent: Thursday, March 20, 2003 10:37 AM
To: ib-support@yahoogroups.com
Subject: [ib-support] Question on delete
I have a query like this:
delete from mytable where mytable.id in ( select id from listtable where
<search condition> )
Usually this query delete only few record from a large table. It works, but
slowly, because FB doesn't use the index on mytable.id.
How can I spedd up this query ?
Thanks in advance
Paolo
Yahoo! Groups Sponsor
<http://rd.yahoo.com/M=245314.3072841.4397732.2848452/D=egroupweb/S=17051153
86:HM/A=1495890/R=0/*http:/www.netbizideas.com/yheb42%20>
<http://us.adserver.yahoo.com/l?M=245314.3072841.4397732.2848452/D=egroupmai
l/S=:HM/A=1495890/rand=336369566>
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to the Yahoo!
<http://docs.yahoo.com/info/terms/> Terms of Service.
[Non-text portions of this message have been removed]