Re: Ignore histograms on sql level

  • From: Sayan Malakshinov <xt.and.r@xxxxxxxxx>
  • To: Tanel Poder <tanel@xxxxxxxxxxxxxx>
  • Date: Wed, 20 Jan 2021 05:48:06 +0300

Hi Tanel,

Anyway, I absolutely agree with your advice to investigate and fix a root
cause of the problem, since it will be a pain-in-the-ass to change the hint
every time you gather statistics to sync it with updated statistics. And
even as a fast workaround I'd prefer to fix good plan using sql
patch/profile/baseline than to hint with column_stats().



--
Best regards,
Sayan Malakshinov
Oracle performance tuning expert
Oracle Database Developer Choice Award winner
Oracle ACE Associate
http://orasql.org

ср, 20 янв. 2021 г., 5:33 Tanel Poder <tanel@xxxxxxxxxxxxxx>:

Cool,

So with COLUMN_STATS you could use a SQL Patch to precisely disable
histogram use for just one column of a single table in a single query.

--
Tanel Poder
https://tanelpoder.com/events


On Tue, Jan 19, 2021 at 5:27 PM Sayan Malakshinov <xt.and.r@xxxxxxxxx>
wrote:

Hi listers,

Jonathan is absolutely correct as always - we can easily get it using the
following format:
column_stats("OWNER"."TABLE", "COLUMN", scale, length=NN distinct=NN
nulls=NN min=NN max=NN)

 Simple example:
// Full example:
https://gist.github.com/xtender/fc3882af2ba3801935bdff2f3c17e567


Other related posts: