Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Flock to Rename Directory

by thunders (Priest)
on Sep 17, 2009 at 17:07 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (1)
As of 2021-09-17 05:06 GMT
Find Nodes?
    Voting Booth?

    No recent polls found