Subject | Re: Disabling triggers |
---|---|
Author | Adam |
Post date | 2005-04-22T06:36:16Z |
Hello Martijn,
Thanks for the suggestion.
Absolutely nothing is wrong with it when working with one or two
triggers. My problem is that there are lots of tables that have foreign
keys pointing to this table with cascading delete or set null rules for
deletion, which is going to obviously fire the before / after update or
delete triggers on those tables.
I started doing it this way but it gets a bit messy. Deleting this
table effectively "empties" the database of all the data that is
important.
Anyhow the script does work and reduces the time to about 20 seconds to
delete 20000 records which is pretty good for my crappy old box. I was
just wondering if there was a better way to disable "all" triggers
while "emptying" my database here.
Thanks
Adam
Thanks for the suggestion.
Absolutely nothing is wrong with it when working with one or two
triggers. My problem is that there are lots of tables that have foreign
keys pointing to this table with cascading delete or set null rules for
deletion, which is going to obviously fire the before / after update or
delete triggers on those tables.
I started doing it this way but it gets a bit messy. Deleting this
table effectively "empties" the database of all the data that is
important.
Anyhow the script does work and reduces the time to about 20 seconds to
delete 20000 records which is pretty good for my crappy old box. I was
just wondering if there was a better way to disable "all" triggers
while "emptying" my database here.
Thanks
Adam