Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Reverse operations for category deletion?

Quote Reply
Reverse operations for category deletion?
Hi. Just wondering.. when a category deletion process stops due to a timeout, you get the problem with category_id's not found errors being show left right and center.

Does LinksSQL delete the root categories first, and work its way down into the sub categories? If so, doesn't that seem to be a bit of a reversed psychology in the matter?

Any feedback is welcome.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Reverse operations for category deletion? In reply to
Not sure, never looked, but deleting downwards is a simpler process, it's walking a tree, in effect, pulling the rug out from under you as you go.

To delete upwards, the most efficient way would be to generate tables of items to be deleted, then delete them. You would not lose anything.

Deleting upwards could also be done by creating your linked hash and deleting leaf nodes in several passes. If the process ever stopped, there would be no broken trees. You have to walk the whole tree, then start deleting leaf nodes. This can potentially crash a system, if the tree to be deleted is large, because the whole tree, or pointer references, have to be stored as a data structure. Hence, the table suggestion above.

This is bringing back bad memories of computer science classes two decades ago.


PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Reverse operations for category deletion? In reply to
True, it may be simpler for smaller categories... but doing it on larger categories is hell, especially when it times out. I've noticed it a lot when doing DMOZ dumps, and then having to delete large categories because they are not needed. If, at any point it times out, the whole deletion process will not run again, and you have to run a CGI script to go through the lsql_Links, lsql_Category and lsql_CatLinks tables, to get rid of the links Frown

The only reason I mention this, is because this problem has just happened to me. The categories were only 1,000 or so links... but the database is 2.7million ... it just gave up, and now I'm having to write a script to get rid of them all :(

Wouldn't it be possible to use the current way for smaller categories, and the reverse of it for anything over say 2,000 links? Maybe something for GT to look into?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!