MySQL Forums
Forum List  »  Performance

Re: Adding limit clause takes query from 2 seconds to 42 minutes
Posted by: Josh H
Date: February 11, 2013 11:22AM

Thanks for the questions and sorry about the delay responding :-)

This is mysql version 5.5.27

The problem appears to be an optimizer bug, and I have opened a bug for it. The order of the joins is reversed if I add a limit clause.

The explain output shows the problem; the join is starting with the larger table (player_record) and then joining in the smaller table (date_curr) without using a key. The correct join, which happens if no limit is applied, is to start with date_curr and then join to player_record using the PRIMARY key.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Adding limit clause takes query from 2 seconds to 42 minutes
1366
February 11, 2013 11:22AM


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.