Press "Enter" to skip to content

Tracking down a Cardinality Issue in a Shared Membership Query

Forrest McDaniel joins tables together:

Even at a full cartesian join, 49 by 49 rows does not produce 27670.

Usually, when the optimizer applies transformations it updates cardinality estimates, but I ran into a particular construction and transformation where it doesn’t (and I don’t know why).

Read on for the example and a workaround that Forrest found.