<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: How to generate a histogram using SQL</title>
	<atom:link href="http://oraqa.com/2006/03/06/how-to-generate-a-histogram-using-sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://oraqa.com/2006/03/06/how-to-generate-a-histogram-using-sql/</link>
	<description>Oracle Question and Answer</description>
	<pubDate>Mon, 06 Oct 2008 14:22:23 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: gamyers</title>
		<link>http://oraqa.com/2006/03/06/how-to-generate-a-histogram-using-sql/#comment-165</link>
		<dc:creator>gamyers</dc:creator>
		<pubDate>Mon, 13 Mar 2006 04:01:18 +0000</pubDate>
		<guid isPermaLink="false">http://oraqa.com/2006/03/06/how-to-generate-a-histogram-using-sql/#comment-165</guid>
		<description>You can derive a height based histogram easily enough with analytics. However I don't see a useful way of displaying that graphically.
&lt;pre&gt;
select bucket, min(object_type), max(object_type), count(*),
count(distinct object_type) 
from  (select object_type, object_name, 
ntile(10) over (order by object_type, object_name) bucket
from all_objects where owner = 'SYSTEM')
group by bucket;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>You can derive a height based histogram easily enough with analytics. However I don&#8217;t see a useful way of displaying that graphically.</p>
<pre>
select bucket, min(object_type), max(object_type), count(*),
count(distinct object_type)
from  (select object_type, object_name,
ntile(10) over (order by object_type, object_name) bucket
from all_objects where owner = 'SYSTEM')
group by bucket;
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl Reitschuster</title>
		<link>http://oraqa.com/2006/03/06/how-to-generate-a-histogram-using-sql/#comment-161</link>
		<dc:creator>Karl Reitschuster</dc:creator>
		<pubDate>Fri, 10 Mar 2006 06:12:11 +0000</pubDate>
		<guid isPermaLink="false">http://oraqa.com/2006/03/06/how-to-generate-a-histogram-using-sql/#comment-161</guid>
		<description>Sorry for confusion. I thought about an example out of the HR Data to generate a Height based Histogram. For example your Frequncy histogram has 11 Buckets - the departments. If there would be thousands of departments you would need to aggregate that with fewer buckets. I will try an example out of the HR-Schema with the same data when i have time to do this.

Background is that the understanding of these tow historgram type would increase with these examples.

Greetings
Karl</description>
		<content:encoded><![CDATA[<p>Sorry for confusion. I thought about an example out of the HR Data to generate a Height based Histogram. For example your Frequncy histogram has 11 Buckets - the departments. If there would be thousands of departments you would need to aggregate that with fewer buckets. I will try an example out of the HR-Schema with the same data when i have time to do this.</p>
<p>Background is that the understanding of these tow historgram type would increase with these examples.</p>
<p>Greetings<br />
Karl</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Awad</title>
		<link>http://oraqa.com/2006/03/06/how-to-generate-a-histogram-using-sql/#comment-160</link>
		<dc:creator>Eddie Awad</dc:creator>
		<pubDate>Fri, 10 Mar 2006 05:10:41 +0000</pubDate>
		<guid isPermaLink="false">http://oraqa.com/2006/03/06/how-to-generate-a-histogram-using-sql/#comment-160</guid>
		<description>Well, an example of the data behind a height-balanced histogram (from the HR schema in my XE database):

&lt;pre&gt;
SELECT endpoint_number, endpoint_value 
  FROM ALL_HISTOGRAMS
 WHERE table_name = 'EMPLOYEES' and column_name = 'SALARY'
  ORDER BY endpoint_number
&lt;/pre&gt;

&lt;pre&gt;
ENDPOINT_NUMBER        ENDPOINT_VALUE         
---------------------- ---------------------- 
0                      2100                   
1                      2600                   
2                      2900                   
3                      3200                   
4                      4200                   
5                      6400                   
6                      7400                   
7                      8300                   
8                      9500                   
9                      11500                  
10                     24000                  

11 rows selected
&lt;/pre&gt;

How do you imagine the result set above be represented graphically?</description>
		<content:encoded><![CDATA[<p>Well, an example of the data behind a height-balanced histogram (from the HR schema in my XE database):</p>
<pre>
SELECT endpoint_number, endpoint_value
  FROM ALL_HISTOGRAMS
 WHERE table_name = 'EMPLOYEES' and column_name = 'SALARY'
  ORDER BY endpoint_number
</pre>
<pre>
ENDPOINT_NUMBER        ENDPOINT_VALUE
---------------------- ----------------------
0                      2100
1                      2600
2                      2900
3                      3200
4                      4200
5                      6400
6                      7400
7                      8300
8                      9500
9                      11500
10                     24000                  

11 rows selected
</pre>
<p>How do you imagine the result set above be represented graphically?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl Reitschuster</title>
		<link>http://oraqa.com/2006/03/06/how-to-generate-a-histogram-using-sql/#comment-158</link>
		<dc:creator>Karl Reitschuster</dc:creator>
		<pubDate>Thu, 09 Mar 2006 09:21:31 +0000</pubDate>
		<guid isPermaLink="false">http://oraqa.com/2006/03/06/how-to-generate-a-histogram-using-sql/#comment-158</guid>
		<description>Hi Eddie,
your example shows very good how a Frequency Histogram works. Do you have an example(sql) / idea how to generate a height based histogram with your pseudo graphical output?

from the Oracle Server Performance Guide :

Frequency Histograms
In a &lt;b&gt;frequency histogram&lt;/b&gt;, each value of the column corresponds to a single bucket of
the histogram. Each bucket contains the number of occurrences of that single value.
Frequency histograms are automatically created instead of height-balanced histograms
when the number of distinct values is less than or equal to the number of histogram
buckets specified. Frequency histograms can be viewed using the *TAB_HISTOGRAMS
tables, as shown in Example 14â€“2.

Height-Balanced Histograms
In a &lt;b&gt;height-balanced&lt;/b&gt; histogram, the column values are divided into bands so that each
band contains approximately the same number of rows. The useful information that
the histogram provides is where in the range of values the endpoints fall.

Greetings
Karl</description>
		<content:encoded><![CDATA[<p>Hi Eddie,<br />
your example shows very good how a Frequency Histogram works. Do you have an example(sql) / idea how to generate a height based histogram with your pseudo graphical output?</p>
<p>from the Oracle Server Performance Guide :</p>
<p>Frequency Histograms<br />
In a <b>frequency histogram</b>, each value of the column corresponds to a single bucket of<br />
the histogram. Each bucket contains the number of occurrences of that single value.<br />
Frequency histograms are automatically created instead of height-balanced histograms<br />
when the number of distinct values is less than or equal to the number of histogram<br />
buckets specified. Frequency histograms can be viewed using the *TAB_HISTOGRAMS<br />
tables, as shown in Example 14â€“2.</p>
<p>Height-Balanced Histograms<br />
In a <b>height-balanced</b> histogram, the column values are divided into bands so that each<br />
band contains approximately the same number of rows. The useful information that<br />
the histogram provides is where in the range of values the endpoints fall.</p>
<p>Greetings<br />
Karl</p>
]]></content:encoded>
	</item>
</channel>
</rss>
