Basic SQL Query Plan Qs

  • From: VIVEK_SHARMA <VIVEK_SHARMA@xxxxxxxxxxx>
  • To: "oracle-l@xxxxxxxxxxxxx" <oracle-l@xxxxxxxxxxxxx>, "sfaroult@xxxxxxxxxxxx" <sfaroult@xxxxxxxxxxxx>
  • Date: Tue, 19 Feb 2008 06:11:40 +0530

Folks

SQL Query:-

select ..
from DTD
where account_num='N1'
and tran_date='10-02-2005'

NOTE - DTD Table has 400,000 rows approx with ALL its Records having just 1 
Date Value '12-06-2005' (i.e. a date value which is NOT in the SQL Query)
DTD Table has multiple values of account_num but does NOT have the specific 
account_num 'N1' specified in the SQL Query.

Running on which of the following indexes will be most performing & why?

Index 1 - Unique index on (tran_date, some field2, another field3)
Index 2 - account_ num
Index 3 - (account_ num, tran_date)

Optimizer - CBO
Oracle 10.2.0.3

Cheers & Thanks

Vivek

**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are 
not to copy, disclose, or distribute this e-mail or its contents to any other 
person and any such actions are unlawful. This e-mail may contain viruses. 
Infosys has taken every reasonable precaution to minimize this risk, but is not 
liable for any damage you may sustain as a result of any virus in this e-mail. 
You should carry out your own virus checks before opening the e-mail or 
attachment. Infosys reserves the right to monitor and review the content of all 
messages sent to or from this e-mail address. Messages sent to or from this 
e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***
--
//www.freelists.org/webpage/oracle-l


Other related posts: