I am trying a delete statement as follows which is taking a long time
although the tables concerned are not large.
delete from table where value not in ('a','b','c'....'s')
table as a trigger operation to delete from further child tables.
Is there any way to speed this query?bjones wrote:
> I am trying a delete statement as follows which is taking a long time
> although the tables concerned are not large.
> delete from table where value not in ('a','b','c'....'s')
> table as a trigger operation to delete from further child tables.
> Is there any way to speed this query?
NOT IN cannot be index optimized. Every time you perform a delete, the
table has to be scanned and the value column checked against each
element in the IN clause. I'm not sure what you mean by "table as a
trigger operation to delete from further child tables". It would help if
you could provide DDL and full explanation of what you need to do.
David Gugick
Quest Software
www.imceda.com
www.quest.com
No comments:
Post a Comment