I have a main table called Campaign. The campaign identifier is the foreign key in another table CampaignRun, and the CampaignRun identifier is the foreign key in the third table CampaignRecipient. Due to my CASCADE requirements I use
DELETE FROM Campaign WHERE Id = x
Delete all related campaign information. But this function becomes very heavy on the server and, of course, locks tables during operation. I was wondering if there is a faster way to work with DELETE FROM. TRUNCATEworks faster, but unfortunately, it does not accept any conditions.
Any work offers will be appreciated.
source
share