In addition to the useful tip related to FOR ALL ENTRIES, one should be sure the internal table, used in the FOR...
By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
ALL ENTRIES clause in not empty. If the table is empty, ALL ENTRIES will be selected. (Actually, all WHERE clauses are neglected)
Of course, you should also be sure you select on INDEX fields. Otherwise the use of FOR ALL ENTRIES increases the runtime instead of improving it.