MySQL Forums
Forum List  »  Stored Procedures

Re: How to prepare a bulk insert statements and execute them in a single query
Posted by: Peter Brawley
Date: July 24, 2012 01:21AM

A table without a PK isn't a real table. It's hard to imagine a valid reason for not giving a large table like this a PK.

The fact that a table got this far without a PK, combined with the overwhelmimg and performance-killing complexity of this query, suggests other design problems may underly the performance problem you are experiencing.

Have you run the query through EXPLAIN EXTENDED? I expect the results will show why the server is choking on this monster, especially the multiple unoptimisabe join conditions.

I'd expect the solution to require breaking down this query into several steps, and perhaps moving some of those steps to earlier processing stages. And given the complexity of these joins, you may have to rethink some table designs.

Finally, how in the world do your programmers work with such complexity without formatting it for human readability!?

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.