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?
Subject
Views
Written By
Posted
3188
December 31, 2005 06:11AM
1409
December 31, 2005 07:53PM
1414
January 01, 2006 03:40AM
1578
January 01, 2006 08:01AM
Re: Slow query if using arithmetic (+1) in Where Clause
1401
January 01, 2006 09:22AM
1793
January 01, 2006 07:42PM
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.