A JOIN
from T1
to T2
(and T3
) can lead to more records than just those in T1
. Say that for each record in T1
there are two records in T2
, then for 1000 records in T1
the result of the count is 2000.
In theory the optimizer could know that T1.ID
and T2.ID
are both primary keys (or unique) and therefor only scan T1
, but the optimizer in Firebird is not very advanced, so maybe it simply can't do that.