Just recently saw an application that used complex SQL statements (sorta depending on the database optimizer to optimize them) where the optimizer turned brain-dead.

Sometimes, the human brain really is smarter than these "intelligent" algorithms they put into databases nowdays. The particular statements in question would *probably* be executed much faster by splitting the statement (a multi-table select) into separate statements, or by using (alas proprietory) database directives to tell the optimizer what to do.