Are there any shortcuts can be taken by manual table deletes

 
Post new topic   Reply to topic    newsmanpro.com Forum Index : Usage and Configuration
View previous topic :: View next topic  
Author Message
Ready_Eddie
Experienced
Experienced


Joined: 06 Jun 2005
Posts: 248
Location: Detroit

PostPosted: Tue Jan 05, 2010 6:55 am    Post subject: Are there any shortcuts can be taken by manual table deletes Reply with quote

A bit ago I decided to delete one of my workgroups and start over with it.

So I did a remove workgroup. That was eight hours ago, and my drives are still clacking away. I see a "delete wgparts16.* from wgparts16" with a "left join on wgheaders", etc, in progress on a connection. wgparts16 is 14Gig big, which is why I'm trashing it and starting over.

Is there a way one can blow away the wgparts table files and have NMP repair the wgheaders, etc, more simply? I seem to recall you could substitute empty wgparts tables and then have wgheaders cleanup via repair.

The larger general question is are there any shortcuts users can take by manually deleting/manipulating tables?


Last edited by Ready_Eddie on Wed Jan 06, 2010 4:39 am; edited 1 time in total
Back to top
View user's profile Send private message
administrator
Developer
Developer


Joined: 24 Jul 2004
Posts: 4752
Location: King William, VA

PostPosted: Tue Jan 05, 2010 1:25 pm    Post subject: Reply with quote

Yes, but you'll need to issue SQL queries in order to do it. Since the segments table is named "wgparts16", that tells us that you want to remove Workgroup ID 16. To do this, issue the following queries:

Code:
truncate table wgparts16


then:

Code:
delete from wgheaders where WorkgroupID = 16


and finally:

Code:
drop table wgparts16


This will remove the bulk of the data related to the Workgroup, but you'll also want to run a database sweep and then optimize it afterwards (unless you are using MS SQL Server).

The bigger problem for you is how to stop the current transaction that has been running without corrupting your database. With MS SQL Server, you could kill the connection and SQL Server will roll the transaction back. This takes almost as long as the query was running, but it preserves data integrity. MySQL (using MyISAM) and ADS don't do this, so you may end up having to repair your database.

What NMP is trying to do is to remove all of the data related to the Workgroup you are removing, so it does take longer, but is very thorough.

Regards
Back to top
View user's profile Send private message Send e-mail
Ready_Eddie
Experienced
Experienced


Joined: 06 Jun 2005
Posts: 248
Location: Detroit

PostPosted: Wed Jan 06, 2010 3:34 am    Post subject: Reply with quote

Excellent! My Slow Query Log says the "delete wgparts16.*" took 74573 seconds, or 20 hours 43 minutes. Looks like a couple queries later NMP gave up the ghost, at least it was gone when I came home. The workgroup, headers and parts table file are still there, but all the message parts are missing in the properties, as expected.

I don't want to do that again, I'll try your queries.

What does a database sweep actually do?

I often use MySQL Administrator to do table repair and optimize. Does the NMP repair and optimize do the same (for all the tables), then does the sweep address inter-table issues?

By the way, I had to dig to find how to do a database sweep. Searching the wiki shows that the word "sweep" is never used.
Back to top
View user's profile Send private message
administrator
Developer
Developer


Joined: 24 Jul 2004
Posts: 4752
Location: King William, VA

PostPosted: Wed Jan 06, 2010 11:27 am    Post subject: Reply with quote

I suspect MySQL ran out of memory trying to run that query. Since you say that the parts have been removed, then that's the worst of it.

Removing a large Workgroup is problematic using NMP unless you delete and purge all the messages first. I'll make a note to review this process to see if there might be ways to improve the process.

The database sweep checks for orphaned data between tables.

NMP's repair facilities are a subset of what is available using MySQL Administrator. For example, NMP cannot repair a corrupted table header while MySQL Administrator gives you that option. For optimizing tables, NMP uses the same commands that MySQL Administrator uses.

Regards
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    newsmanpro.com Forum Index : Usage and Configuration All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Copyright 2003-2006, Daniel Cumpian
NMP Default By ::Dementeddogz.com::