cancel
Showing results for 
Search instead for 
Did you mean: 

How efficient is autoRename function in Rest API

janardhanc
Champ on-the-rise
Champ on-the-rise

How efficient is autoRename function in Rest API?

I want to name all my documents in a folder as "doc", set autoRename flag to true and call create document Rest API, how efficient is autoRename function if the folder has 100000 docs? Will the Rest API try an incrementing number for 100000 times, fail and finally arrive at 100001 to succeed? If yes, that would take 100000 failed retries before a success and would be very inefficient and the performance would degrade linearly as the number of documents increase in the folder.

Thanks.

1 ACCEPTED ANSWER

afaust
Legendary Innovator
Legendary Innovator

Well, I don't know what you expect the autoRename function to do apart from trying integer suffixes in turn until a non-conflict is found. Of course this is extremely inefficient if you start storing more than just a handful of files with the same name. If you do not care for the name of the documents in the first place, why not have your client generate a uuid and use that for the name? That way you should be able to avoid any conflicts and degradation of performance due to renaming.

View answer in original post

1 REPLY 1

afaust
Legendary Innovator
Legendary Innovator

Well, I don't know what you expect the autoRename function to do apart from trying integer suffixes in turn until a non-conflict is found. Of course this is extremely inefficient if you start storing more than just a handful of files with the same name. If you do not care for the name of the documents in the first place, why not have your client generate a uuid and use that for the name? That way you should be able to avoid any conflicts and degradation of performance due to renaming.