I have an agent that runs manually from Actions menu on selected documents. This is taking more than 5 minutes to run. All this does is, gets the collection of some documents that are related to the selected documents and process result to a result document. Db.search has been used to get the collection. Also checking to see if there is(are) any result document(s) previously created for the selected documents through db.search method.
I debugged the code and found that it is taking a more than a minute to get collection of 20 documents through db.search. I am wondering if I replace the db.search by creating a view.
My question is which of the two is faster?
view.GetAllDocumentByKey vs db.Search
Any response is greatly appreciated.