Results 1 to 2 of 2

Thread: Histogram

  1. #1
    Join Date
    Jan 2010
    Posts
    72

    Unanswered: Histogram

    What is meant by histogram and what is the best range of values for this? and how it will be used?

  2. #2
    Join Date
    Aug 2010
    Posts
    19
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •