it's optimal when both tables are large and no useful index exists. But when you can restructure the query to make nested loop viable (through better indexing or query consolidation), nested loop with a good index often wins.