RE: autotrace issue

  • From: "Yasin Baskan" <yasbs@xxxxxxxxxxxxxx>
  • To: <madan.sanjay@xxxxxxxxx>, <oracle-l@xxxxxxxxxxxxx>
  • Date: Fri, 14 Oct 2005 14:37:08 +0300


Isn't it normal that the plan changes with the actual value in the where
clause. That is what the optimizer does. You can use a bind variable
instead of that literal and see what the plan is.



________________________________

From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Sanjay Madan
Sent: Friday, October 14, 2005 2:01 PM
To: oracle-l@xxxxxxxxxxxxx
Subject: autotrace issue



Hi ,

Oracle 9.2.0.5 on AIX
Partitioned table ( list) ~ 10 mil rows in all distibuted almost equally
across 5 partitions
field1 ( used in the query) is not the PK.

My autotrace ( traceonly explain) output for a particular query changes
with the actual value of the input parameter.


select .......
where ...........
and  field1 = 123456

autotrace output shows an Index range scan whereas

select .......
where ...........
and  field1 = 1234561

autotrace output shows  a full table scan
(not the exact input values) ...

I have tried values
-both within and outside the field lengths of field1
-values actually existing in the table
-values NOT existing in the table.

It seems to be happening randomly.  For most values it shows an index
range scan.
For others  (fewer) it shows a full table scan.

Any hints as to what could be happening or where I should look to solve
the problem ?


Thanks

sanjay





Bu mesaj ve onunla iletilen tum ekler gonderildigi kisi ya da kuruma ozel ve 
Bankalar Kanunu geregince, gizlilik yukumlulugu tasiyor olabilir. Bu mesaj, 
hicbir sekilde, herhangi bir amac icin cogaltilamaz, yayinlanamaz ve para 
karsiligi satilamaz; mesajin yetkili alicisi veya alicisina iletmekten sorumlu 
kisi degilseniz, mesaj icerigini ya da eklerini kopyalamayiniz, yayinlamayiniz, 
baska kisilere yonlendirmeyiniz ve mesaji gonderen kisiyi derhal uyararak bu 
mesaji siliniz. Bu mesajin iceriginde ya da eklerinde yer alan bilgilerin 
dogrulugu, butunlugu ve guncelligi Bankamiz tarafindan garanti edilmemektedir 
ve bilinen viruslere karsi kontrolleri yapilmis olarak yollanan mesajin 
sisteminizde yaratabilecegi zararlardan Bankamiz sorumlu tutulamaz.

This message and the files attached to it are under the privacy liability in 
accordance with the Banking Law and confidential to the use of the individual 
or entity to whom they are addressed. This message cannot be copied, disclosed 
or sold monetary consideration for any purpose. If you are not the intended 
recipient of this message, you should not copy, distribute, disclose or forward 
the information that exists in the content and in the attachments of this 
message; please notify the sender immediately and delete all copies of this 
message. Our Bank does not warrant the accuracy, integrity and currency of the 
information transmitted with this message. This message has been detected for 
all known computer viruses thence our Bank is not liable for the occurrence of 
any system corruption caused by this message

Other related posts: