New answers tagged

1

Your gut feeling is somewhat correct. It's hard to get precise measurements because of the nature of how Apex executes on a shared resource, but generally speaking, if you anticipate less than about 50 values, using the if statement is very, very slimly faster (~1/100th of a second), and for about every ~200 values, the if statement version takes longer than ...


3

You need at least one indexed field in order to avoid expensive table scans, and potentially query timeout problems or non-selective query errors. You have two real options. First, use your first option. The OR operator will be just fine, as long as you're not filtering for null. The second option is to use the formula field, but request a custom index. ...


Top 50 recent answers are included