Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

oracle query to mysql left joins

i migrated the company oracle database to mysql (yeah don't ask me why) and few queries (for reporting) are huge and working in mysql

one of them is 4021 lines with 89 INNER JOIN

this one generates a fully details report for the company client for financial for the last year.

i need that report (since we getting to the end of the year soon) working for 2011 and i saw on many website that the max left join for mysql is 60 something left join.

am i screwed with this report? or there's a way for me to run it?

like image 755
Derek Avatar asked Dec 10 '11 03:12

Derek


Video Answer


1 Answers

I think your report query will anyway result in using temporary in EXPLAIN. You can break your single query into several in a transaction and make the temporary tables explicitly.

This can be even more helpful if your Oracle query contains something like named subqueries (I mean WITH subqueries from T-SQL, I do not know if they exist in Oracle, but definitely do not exist in MySQL).

like image 76
newtover Avatar answered Sep 25 '22 00:09

newtover