MySQL Forums
Forum List  »  Performance

Re: Slow query if using arithmetic (+1) in Where Clause
Posted by: Ran Geva
Date: January 01, 2006 09:22AM

Well as you can see from the EXPLAIN. It needs to go through 160512 rows Using where; Using index. Only 1 row for the rest.
The thing is that I ran only the problematic query:

SELECT aa.COL2 FROM Table2 AS aa , Table2 AS bb WHERE
aa.COL1 = 602 AND
bb.COL1 = 276 AND
aa.COL2 = bb.COL2 AND
aa.COL3 + 1 = bb.COL3
LIMIT 0,250;

Only when I added "aa.COL3 + 1 = bb.COL3" the query slowed down... Both cases the row number was the same...

Any ideas?

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Slow query if using arithmetic (+1) in Where Clause
1401
January 01, 2006 09: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.