V2.0-beta.20180312 wrong plan

This was also in earlier releases but I now had a little time:
select distinct d.triggerid_down,d.triggerid_up from trigger_depends d,triggers t,hosts h,items i,functions f where t.triggerid=d.triggerid_down and t.flags<>2 and h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=d.triggerid_down and h.status in (0,1);
The above gets a cross join - unexpected
rewritten as:
select distinct d.triggerid_down,d.triggerid_up
from trigger_depends d join triggers t
on (t.triggerid = d.triggerid_down)
join functions f
on (f.triggerid = d.triggerid_down)
join items i
on (i.itemid = f.itemid)
join hosts h
on (h.hostid = i.hostid)
where t.flags<>2
and h.status in (0,1)

it runs as expected, sub second. Too bad I have no control over the SQL.
Is this something that can be fixed? It looks like a query planner problem to me, that handles ANSI sql better …
(if needed I can supply a schema and data)

Yes, our query planner sometimes makes odd index or join decisions. We are currently working hard on an optimizer to improve these kinds of bad plans. This is not going to get fixed in a future 2.0 release, but we expect improvements of this kind to be present in 2.1. Try an alpha in a few months when we begin releasing them again for the 2.1 release, and these things may improve.