Press "Enter" to skip to content

When Self-Joins Beat Lookups

Erik Darling shows us an interesting scenario:

Whether the lookup is Key or RID depends on if the table has a clustered index, but that’s not entirely the point.

The point is that there’s no way for the optimizer to decide to defer the lookup until later in the plan, when it might be more opportune.

Read on for the situation and the solution.