Subject Determining Join Order
Author Tom Conlon
http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_quep

'...In joining two or more streams together, it is often crucial to
determine which stream should be retrieved first. In general, the
stream which is the most expensive to retrieve should be retrieved
first. If you think of a join as a set of nested loops, it makes sense
that the innermost loop will be executed the most times. Similarly,
the last stream in the join list will be fetched the most times, so it
had better be the cheapest to retrieve.'

Is this still the case (FB 1.5 & 2.0)?

> the last stream in the join list will be fetched the most times

Can someone confirm what the 'last stream' in the following 2 cases:

1.
SELECT distinct d.docid
FROM document d
JOIN documentwords dw1 ON (d.docid=dw1.docid)
JOIN documentwords dw2 ON (dw2.docid=dw1.docid) AND (dw2.WORDID=338)
WHERE (dw1.wordid=301) <-- does this exec first?

2.
SELECT distinct d.docid
FROM document d
WHERE d.docid>7000 and <-- does this exec first?
EXISTS
(
SELECT 1 from documentwords dw1
WHERE (dw1.docid=d.docid) AND (dw1.WORDID=338)
)

Thanks,
Tom