the histogram is a principle to describe data in a table,
let say you have a table with the following data:
1 1 1 2 3 3 4 4 4 5 6 7 8 9 9 9 9 9 9 9
now we create simple histogram:
max nr_of_records meaning
2 4 there are 4 records with the value 2 or smaller
4 5 there are 5 records between 2 and 4
9 6 there are 6 records beween 5 and 9
this is very simple histogram, based on this the query optimizer can choose a "good" plan to execute.
lets say you have a table with just 2 Values:
1 which occurs just once and
2 which occurs 1 000 000 00 times.
with a proper histogram / statistics the optimizer will decide to use an index on the table for the value 1
and a full table scan for the value 2.