RE: [Non-DoD Source] RE: index hint returns wrong results

From: Terrian, Thomas J CTR (US) <"Terrian,>
Date: Tue, 8 Mar 2016 16:30:02 +0000
Message-ID: <EC0CCA09F117ED43ACBDEEF40E0BB4944BD6FD8F_at_HL01DAG4MB2.DIR.AD.DLA.MIL>



I agree. I think this might be a significant bug in Oracle. The results should be the same no matter if I use the index or not.

I have a ticket in with Oracle now. I have also dropped the index and am recreating it now even though I didn't see anything wrong with it structurally (v$database_block_corruption, etc.).

I will update this tread with the results.

-----Original Message-----

From: Mark W. Farnham [mailto:mwf_at_rsiz.com] Sent: Tuesday, March 08, 2016 11:23 AM
To: Terrian, Thomas J CTR (US); 'Jonathan Lewis'; oracle-l_at_freelists.org Subject: [Non-DoD Source] RE: index hint returns wrong results

First, let's be clear: If Oracle returns incorrect results, then there most definitely is a bug in the stack somewhere. Even if the data has been FUBAR'd due to PEBKAC, it is incumbent on the RDBMS to prevent delivery of a response without tossing an error.

Second, mmm, it seems to me it would be very useful to try to develop a degenerate (meaning no more complicated than required) case from creation and population scripts to wrong results so others can help isolate which versions may be affected and any required "avoid doing this" work-around advice to the community until the bug is fixed.

mwf

-----Original Message-----

From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Terrian, Thomas J CTR (US)
Sent: Tuesday, March 08, 2016 8:51 AM
To: Jonathan Lewis; oracle-l_at_freelists.org Subject: RE: index hint returns wrong results

That is interesting.

Even when I use the partition name, I still get bad results:

select /*+ index(t1 ind1) */ count(*)
from scott.t1 partition (sys_p14)
where f1 = 'one' and f2 = ' ';

  COUNT(*)


         2

There is only 1 row in that table where f1 = 'one' and f2 = ' '.

And I see partition pruning in the explain plan when it tries to access the table (not for the global index of course).

-----Original Message-----

From: Jonathan Lewis [mailto:jonathan_at_jlcomp.demon.co.uk] Sent: Tuesday, March 08, 2016 8:05 AM
To: Terrian, Thomas J CTR (US); oracle-l_at_freelists.org Subject: [Non-DoD Source] RE: index hint returns wrong results

If the table is partitioned then I think it's possible for the error to appear as a result of procedural error on the part of the application.

I'd have to check but I think you might be able to do an exchange partition including indexes without validation that got data into the wrong partition which wouldn't be seen by a (partition eliminating) tablescan but was seen by a range scan of a global index.

This may be version dependent, of course thanks to enhancements in global index usage.

Regards
Jonathan Lewis
http://jonathanlewis.wordpress.com
_at_jloracle



From: oracle-l-bounce_at_freelists.org [oracle-l-bounce_at_freelists.org] on behalf of Terrian, Thomas J CTR (US) [Tom.Terrian.ctr_at_dla.mil] Sent: 08 March 2016 12:32
To: oracle-l_at_freelists.org
Subject: index hint returns wrong results

Oracle 12c.

Am I missing something or is this a bug? Using an index hint returns the wrong results. Does it matter if the table is partitioned and the index is global or even what fields are in the index? I can't see how any of that should matter. The results should be the same:

select /*+ index(t1 ind1) */ count(*)
from scott.t1
where f1 = 'one' and f2 = ' ';

  COUNT(*)


         2

select count(*)
from scott.t1
where f1 = 'one' and f2 = ' ';

  COUNT(*)


         1

--

http://www.freelists.org/webpage/oracle-l

--

http://www.freelists.org/webpage/oracle-l

--

http://www.freelists.org/webpage/oracle-l Received on Tue Mar 08 2016 - 17:30:02 CET

Original text of this message