I think it has to do with the way MySQL rewrites the query. When you do
SHOW CREATE VIEW
or
SELECT VIEW_DEFINITION
I've observe joins being rewritten to include parentheses; I can imagine this influencing the execution plan, especially when the query has more than one join. An exapmple FROM clause is entered in the CREATE VIEW statement:
from node rn
inner join node dn
on rn.left_node <= dn.left_node
and rn.right_node >= dn.left_node
inner join node an
on dn.left_node >= an.left_node
and dn.left_node <= an.right_node
and an.left_node >= rn.left_node
and an.left_node <= rn.right_node
and this is returned by SHOW CREATE VIEW:
from
(
(`tree`.`node` `rn` join `tree`.`node` `dn` on
(
(
(`rn`.`left_node` <= `dn`.`left_node`)
and (`rn`.`right_node` >= `dn`.`left_node`)
)
)
)
join `tree`.`node` `an` on
(
(
(`dn`.`left_node` >= `an`.`left_node`)
and (`dn`.`left_node` <= `an`.`right_node`)
and (`an`.`left_node` >= `rn`.`left_node`)
and (`an`.`left_node` <= `rn`.`right_node`)
)
)
)
(i inserted some linebreaks to make it a bit more readable)
There are some other issues related to this query rewrite, see:
http://bugs.mysql.com/bug.php?id=12489
and heed the use of the CURRENT_USER function and SELECT * queries on this page
http://mysql.gilfster.com/page.php?parent_id=3&page_id=3.0.2