Hi everyone! I'm currently working on a query that makes the (rather bad) MySQL optimizer choke. After running EXPLAIN, I noticed that MySQL was taking a pretty long time to optimize it (about 130 seconds) and was then producing a rather unintuitive join order. I tried replacing the JOIN operators by STRAIGHT_JOIN which is the MySQL way to force the join order to be the one used in the query, and that happened to yield a very good execution time.
My problem now is that, after several hours of searching the Internet, I haven't found a way to make SQLAlchemy generate STRAIGHT_JOIN instead of the usual JOIN. This should be no problem, as STRAIGHT_JOIN has essentially the same semantics as JOIN (it should produce exactly the same result set) but I don't find a way to do it with SQLAlchemy. Any suggestions on how to achieve this will be greatly appreciated. Cheers, Martín -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To view this discussion on the web visit https://groups.google.com/d/msg/sqlalchemy/-/zKH343dWzVEJ. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.