Switch from LEFT to INNER joins.

INNER joins are often more efficient as they can result in fewer rows
being examined before a result set is generated.

Fixes #3968