Re: Why does a hard parse access data in the table in the query?

  • From: Mladen Gogala <gogala.mladen@xxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Thu, 7 Feb 2019 19:36:44 -0500

Norman, if you use global temporary tables, the dynamic sampling will gather statistics on them each and every time, even in Oracle 11G. There is a whole philosophy around GGT's in 12c, but I still prefer the good, old dynamic sampling.

Regards

On 2/7/19 9:06 AM, Norman Dunbar wrote:

On 07/02/2019 10:19, Norman Dunbar wrote:
I get the feeling I should know this, but it seems to have aged out of the cache!

Thanks to everyone who said "dynamic sampling" because that's what it appears to be. I haven't traced it yet, but:

* It was a hard parse;
* Optimizer_dynamic_Sampling = 2 (the default)

Unfortunately, the stats on this database are gathered very frequently. So the default says to "gather dynamically when one or more of the tables has no stats" means that I shouldn't be seeing dynamic sampling.

Maybe, because stats go stale pretty quickly on some tables, it's taking "stale" to mean "none"? I wonder.

Anyway, thanks again, you have been most helpful and hopefully, this won't age out of cache too soon! :o)


Cheers,
Norm.


--
Mladen Gogala
Database Consultant
Tel: (347) 321-1217

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


Other related posts: