Hi Team, I would like to discuss on a scenarios and what to understand how would other see the scenario. Scenario - I have a list of 50,000 record and I need to find a record based on their names(Names are always unique) when necessary. Finding the record is happening inside a loop when some condition is met(some logic is been processed) Option 1 - Retreive the list of 50,000 records outside of the loop, find the record inside the loop using a find activity. Option 2 - Just write a OQL query to fetch the record - there by avoiding the retrival of 50,000 records and finding the record. Which option is best and why do you think so! Appreciate you efforts for reading this question!
asked
Jhansi laxmi Mora
1 answers
2
Ignore option 1. That would take too much memory. Option 2 only if you need OQL to meet the conditions you talked about, or if you need a case insensitive search. Otherwise just do a database retrieve with an xpath constraint on the name. Maybe put an index on the name if that table is (way) more often searched using the name than written to, to improve retrieval performance.