Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Same SQL statement, Same Oracle, Different OS ==> Different Expla

Same SQL statement, Same Oracle, Different OS ==> Different Expla

From: Sam Bootsma <SamB_at_cpas.com>
Date: Fri, 13 Sep 2002 10:43:20 -0800
Message-ID: <F001.004CFB8F.20020913104320@fatcity.com>


Thanks to everybody who responded to the email.

We will be asking our client running on UNIX to build these two indexes in a specific order so that the RBO will select the proper index.

Thanks again,

Sam.


 Date: Fri, 6 Sep 2002 13:41:23 -0400
 Subject: Same SQL statement, Same Oracle, Different OS ==> Different Expla

Hello everybody,

One of our developers is encountering a situation where Oracle 9.0.x explain plan chooses one index when on UNIX, and chooses a different index when running on Windows NT. I'd appreciate any insights or similar experiences.

The following are the facts:
1. The explain plan is run against the same SELECT statement on both platforms
2. It has been confirmed that there are no statistics on either of the databases
3. Both databases are using RBO (not CBO) 4. The UNIX database has about 100 times as many rows (in this table) as the NT database
5. The SELECT statement that gives different explain plans on different platforms is:

SELECT FN.*, FN.ROWID
FROM UNITFUND FN
WHERE FN.FU_CODE = :cFuCode AND

FN.MKEY = :cMkey AND
FN.CLNT = :sKey AND
FN.PLANNO = :sKey AND
FN.DATE_FROM <= :dDate AND
FN.SOURCE = :cSource AND
FN.TSTATUS  =  'O' 

ORDER BY FN.DATE_FROM, FN.TSECOND; 6. Between the following 2 indexes, Oracle 9.0x chooses (2) on Unix and (1) on Windows NT.
  1. clnt, mkey, planno, fu_code, date_from, source, tracode, tsecond...
  2. date_from, clnt, planno, mkey, fu_code

Any insights from anybody out there? Thanks.

Sam Bootsma, OCP
Technical Support Analyst

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Sam Bootsma
  INET: SamB_at_cpas.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Fri Sep 13 2002 - 13:43:20 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US