Hi, i am new to mysql. i am working on a project in which i have to delete users's record from 17 tables. the problem is that when i delete a record, it takes too much time. I am only providing a sample query.The query i write looks like this
DELETE a, u, pa, pr
from admin a
LEFT JOIN users u ON u.user_id=a.admin_id
LEFT JOIN poll_answers pa ON pa.user_id=a.admin_id
LEFT JOIN product_reviews pr ON pr.user_id = a.admin_id
WHERE a.admin_id=345
i have used this technique to delete from tables.i.e used 17 LEFT JOINS to delete records.
It is working fine but consuming too much time. can somebody help me that how i can optimize query when deleting data from 17 tables.