RE: Deletion Query taking lot of time ....
Posted in 2006
Prateek
Because you do not delete from the table where you do the select I would rather try to first just run a select into a "temp table" and add an index on it.
Maybe do some of the filtering from the temp table and not from the original 2 tables on the select where there is no indexes.
Do the delete using the temp table as a reference.
Regards
David Reed
________________________________________
From: informix-list-bounces@iiug.org [mailto:informix-list-bounces@iiug.org] On Behalf Of prateek jain
Sent: Friday, March 10, 2006 16:56 PM
To: informix-list@iiug.org
Subject: Deletion Query taking lot of time ....
Hello Friends,
I have got a query for deleting records from tables.
the query is taking lot of time
DELETE from table abc where abc_column IN (
Select tab1.col1 from tab1, tab2
where tab1.col1 = tab2.col2
and tab1.date1 is not null
and (tab1.date1< tab2.date or tab1.date2 > tab2.date2)
the query is right now taking 7 hours.
Any way to optimize query
there is no index on the tables and we cann ot create index..thats the problem because it has lot of insertion.
Hoping For a positive response.
________________________________________
Yahoo! Mail
Use Photomail to share photos without annoying attachments.