Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question.

Asked: January 28, 2017 - 4:29 am UTC

Last updated: January 29, 2017 - 5:31 pm UTC

Version: 12c

Viewed 1000+ times

You Asked

Hi Tom,
Please tell me about Histogram in Oracle give an example?

and Connor said...

I am assuming you are referring to histograms as they refer to optimizer statistics ?

If so, there's a great explanation of the types (hybrid, freq, top-n) here

http://www.oracle.com/technetwork/database/bi-datawarehousing/twp-statistics-concepts-12c-1963871.pdf

If you are brand new to the entire concept, then in a nutshell - consider a table with a column called GENDER which records the gender of people who attend computer conferences.

There is likely 2 values (male and female), but does that mean that 50% of the attendees are male and female ? Probably not. It might be 75% male and 25% female - so it would be useful to know that distribution. That is what a histogram does - it provides more information to optimizer to decide how to best run queries.

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

Performance

Get all the information about database performance in the Database Performance guide.