Subject | Re: [firebird-support] Slow query because an index is not picked up during sort |
---|---|
Author | Alec Swan |
Post date | 2012-06-04T22:55:41Z |
>so, if FB optimizes INNER JOIN why didn't it use a more selective index on
> Actually, it doesn't. The order of joins is determined by the optimizer in
> the case of an inner join, but outer joins determine the order
> semantically. Consider this case:
>
commit_number instead of less selective index on source_id? Especially
given that there was an ORDER BY on commit_number?
> select c.city, s.stateNameI am assuming you meant to use LEFT not INNER JOIN, right?
> from cities c
> inner join states s on c.stateCode = s.stateCode
> where c.population > 1000000
>
>
Thanks,
Alec
[Non-text portions of this message have been removed]