|
[
Permalink
| « Hide
]
Sean Leyne added a comment - 09/Sep/08 01:32 PM
Please provide PLANs generated for the statements.
Sean, this is a complete test case :-) You can see exactly the same plans as the reporter:
PLAN (TMP_DATE1 NATURAL) -- for the first query and PLAN (TMP_DATE1 INDEX(TMP_DATE1_IDX1)) -- for the second one Moreover: CREATE INDEX TMP_DATE1_IDX2 ON TMP_DATE1 (DATE1) ; SELECT count(*) FROM TMP_DATE1 T WHERE '01.03.2008' BETWEEN T.DATE1 AND T.DATE2; -- PLAN (TMP_DATE1 INDEX(TMP_DATE1_IDX2)) -- returns correct result (count == 61) The simplified predicate which exposes the bug is: WHERE '01.03.2008' >= T.DATE1 The problem is that the inverted boolean (literal compared to an indexed object) works correctly for an indexed field but fails for an indexed expression. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||