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 personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
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.