When statistics are not available for joins

If statistics are not available for a column in a join, the optimizer uses default values:

Operator type

Examples

Default selectivity

Equality

t1.c1 = t1.c2

1/rows in smaller table

Nonequality

t1.c1 > t1.c2
t1.c1 >= t1.c2
t1.c1 < t1.c2
t1.c1 <= t1.c2

33%

For example, in the following query, the optimizer uses 1/500 for the join selectivity for both tables if there are no statistics for either city column, and stores has 500 rows and authors has 5000 rows:

select au_fname, au_lname, stor_name
    from authors a, stores s
    where a.city = s.city