Jump to content

Deleting from multiple tables


zaver

Recommended Posts

Hello,

 

I am working on a web app that allows users to create accounts and also terminate them. In the case that a user closes the account i must delete his information from multiple tables.

As far as i know i can either use a join delete query or delete sequentially from one table at a time. Please note that my tables are MyISAM not InnoDB (use foreign keys for delete)

 

I need help with the following:

 

1)Is there a difference performance wise in join-deletion vs deleting from one table at a time?

 

2)What do you think is the best way to go with deleting a users info from multiple tables?

 

 

Also I was thinking about creating a "temp delete table" to hold the keys to the entries to be deleted there and perform a mass delete once a week.

 

I guess that might be better than actually deleting all the info on the spot?

 

But again should i use a join delete or sequential ? does it make any difference?

 

 

Any help would be greatly appreciated

 

Thank you,

Zaver

Link to comment
https://forums.phpfreaks.com/topic/151355-deleting-from-multiple-tables/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.