I am running following delete statements i want to know if it is possible at all to combine them somehow:
DELETE from schools where visibility like 'revoked'
DELETE FROM bookmark_schools
WHERE school_id NOT IN (SELECT s.id FROM school s)
DELETE FROM school_addresses
WHERE school_id NOT IN (SELECT s.id FROM school s)
DELETE FROM school_highlights
WHERE school_id NOT IN (SELECT s.id FROM school s)
DELETE FROM school_images
WHERE school_id NOT IN (SELECT s.id FROM school s)
...
And so on i have like 15 queries like this. Is it possible to run them together rather than running them individually?
You can combine them into a single statement as others have indicated, but note that this will still be a single threaded operation.
If your goal is to improve performance / parallelize this operation, you may want to write a script which creates the 15 different client threads to run the statements concurrently.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments