Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Flock to Rename Directory

by thunders (Priest)
on Sep 17, 2009 at 17:07 UTC ( [id://795936]=note: print w/replies, xml ) Need Help??


in reply to Flock to Rename Directory

I agree with everyone else that you want to use a database here.

Additionally the biggest problem with your scheme is that your directories appear to have no unique index, so accessing a record to modify it will take a long time.

As far as I can tell, when you need to update the directory name, you need to scan the entire list of 15,000 items, split the names until you find the one you are looking for, check if there's a lock on the then rename that directory. This is CONSIDERABLY slower then accessing a database table with a unique index. I think that's O(n) vs O(1) complexity where n is the total number of records. In your case up to 15,000 times slower. Plus the database solution is a lot more portable and easier to extend.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://795936]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2024-03-19 09:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found