sql - Speed up very slow query -
I am trying to delete the old records from the old SQLite3 database to 30,000 old records.
I'm using this question to remove:
remove items from items ITEMS_ID IN (SELECT ITEMS_ID) with objects where the last time is not like '2014%' And do not like '2013%' and finally '2012%' and ITEMS_ID! = 1 and ITEMS_ID! = 4); The problem is that I have seen that this query is very slow or better, it is so slow that it takes ages and I have to stop it because it seems stuck.
statement can be quite slow.I think the problem is that
< P> How can I fix this query? Before heavy deletion, make sure there are no triggers behind the curtains, which are < Code> deleteIN ()
withinSELECT
statement is being repeated for each row repeatedI do not think it is possible to temporarily disable triggers in SQLite because it is in other DBMSs. Therefore, you have to do this:
- Delete Trigger Script
- Drop Dump Triggers
- Run Delete Question
- Rebuild the trigger to be removed
Also, try to understand what these triggers are being removed, before disabling them. They can do some important, such data auditing or significant changes to maintain data integrity In this case, there may be anything to wait for some patience to wait and wait for a while.
Comments
Post a Comment