<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Cube, Rollup, Grouping Sets and Grouping IDs</title>
	<atom:link href="http://www.rittmanmead.com/2008/09/10/cube-rollup-grouping-sets-and-grouping-ids/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rittmanmead.com/2008/09/10/cube-rollup-grouping-sets-and-grouping-ids/</link>
	<description>Delivered Intelligence</description>
	<lastBuildDate>Fri, 30 Jul 2010 17:54:00 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Bill Cannon</title>
		<link>http://www.rittmanmead.com/2008/09/10/cube-rollup-grouping-sets-and-grouping-ids/comment-page-1/#comment-8877</link>
		<dc:creator>Bill Cannon</dc:creator>
		<pubDate>Sun, 22 Feb 2009 22:19:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.rittmanmead.com/2008/09/10/cube-rollup-grouping-sets-and-grouping-ids/#comment-8877</guid>
		<description>The rollup works great in toad but fails in obiee with the following error:
Error Codes: YQCO4T56:OPR4ONWY:U9IM8TAC:OI2DL65P
Odbc driver returned an error (SQLExecDirectW).
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27002] Near : Syntax error [nQSError: 26012] . (HY000)
SQL Issued: {call NQSGetLevelDrillability(&#039;SELECT SALES.CHANNEL_ID saw_0, Channels.&quot;Channel Desc&quot; saw_1, Calendar.&quot;Calendar Month Desc&quot; saw_2, SUM(SALES.AMOUNT_SOLD) saw_3 FROM SH WHERE Customers.Country LIKE &#039;&#039;Argentina%&#039;&#039; GROUP BY rollup(SALES.CHANNEL_ID , Channels.&quot;Channel Desc&quot; , Calendar.&quot;Calendar Month Desc&quot;)&#039;)}

I can run the code in toad with the following sql:
select T161.CHANNEL_DESC as c1,
     T268.CALENDAR_MONTH_DESC as c2,
     sum(T245.AMOUNT_SOLD) as c3,
     T161.CHANNEL_ID as c4
from 
     SH.COUNTRIES T175,
     SH.CUSTOMERS T186,
     SH.TIMES T268,
     SH.CHANNELS T161,
     SH.SALES T245
where  ( T175.COUNTRY_ID = T186.COUNTRY_ID and T161.CHANNEL_ID = T245.CHANNEL_ID 
and T186.CUST_ID = T245.CUST_ID and T245.TIME_ID = T268.TIME_ID 
and T175.COUNTRY_NAME like &#039;Argentina%&#039; ) 
group by rollup(T161.CHANNEL_ID, T161.CHANNEL_DESC, T268.CALENDAR_MONTH_DESC)</description>
		<content:encoded><![CDATA[<p>The rollup works great in toad but fails in obiee with the following error:<br />
Error Codes: YQCO4T56:OPR4ONWY:U9IM8TAC:OI2DL65P<br />
Odbc driver returned an error (SQLExecDirectW).<br />
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27002] Near : Syntax error [nQSError: 26012] . (HY000)<br />
SQL Issued: {call NQSGetLevelDrillability(&#8217;SELECT SALES.CHANNEL_ID saw_0, Channels.&#8221;Channel Desc&#8221; saw_1, Calendar.&#8221;Calendar Month Desc&#8221; saw_2, SUM(SALES.AMOUNT_SOLD) saw_3 FROM SH WHERE Customers.Country LIKE &#8221;Argentina%&#8221; GROUP BY rollup(SALES.CHANNEL_ID , Channels.&#8221;Channel Desc&#8221; , Calendar.&#8221;Calendar Month Desc&#8221;)&#8217;)}</p>
<p>I can run the code in toad with the following sql:<br />
select T161.CHANNEL_DESC as c1,<br />
     T268.CALENDAR_MONTH_DESC as c2,<br />
     sum(T245.AMOUNT_SOLD) as c3,<br />
     T161.CHANNEL_ID as c4<br />
from<br />
     SH.COUNTRIES T175,<br />
     SH.CUSTOMERS T186,<br />
     SH.TIMES T268,<br />
     SH.CHANNELS T161,<br />
     SH.SALES T245<br />
where  ( T175.COUNTRY_ID = T186.COUNTRY_ID and T161.CHANNEL_ID = T245.CHANNEL_ID<br />
and T186.CUST_ID = T245.CUST_ID and T245.TIME_ID = T268.TIME_ID<br />
and T175.COUNTRY_NAME like &#8216;Argentina%&#8217; )<br />
group by rollup(T161.CHANNEL_ID, T161.CHANNEL_DESC, T268.CALENDAR_MONTH_DESC)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vengat</title>
		<link>http://www.rittmanmead.com/2008/09/10/cube-rollup-grouping-sets-and-grouping-ids/comment-page-1/#comment-7685</link>
		<dc:creator>Vengat</dc:creator>
		<pubDate>Mon, 12 Jan 2009 18:22:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.rittmanmead.com/2008/09/10/cube-rollup-grouping-sets-and-grouping-ids/#comment-7685</guid>
		<description>Thanks for the wonderful article</description>
		<content:encoded><![CDATA[<p>Thanks for the wonderful article</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Atul</title>
		<link>http://www.rittmanmead.com/2008/09/10/cube-rollup-grouping-sets-and-grouping-ids/comment-page-1/#comment-7149</link>
		<dc:creator>Atul</dc:creator>
		<pubDate>Tue, 23 Dec 2008 13:11:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.rittmanmead.com/2008/09/10/cube-rollup-grouping-sets-and-grouping-ids/#comment-7149</guid>
		<description>Hello, Nice Article and contains wisdom about analytics..... Which indexes should be used in these situations so that repsonse time is about to zero.. can u also post the script for metadata of tables used ? 

Last but not the least do u forsee any drawback using this technique ?

br
atul</description>
		<content:encoded><![CDATA[<p>Hello, Nice Article and contains wisdom about analytics&#8230;.. Which indexes should be used in these situations so that repsonse time is about to zero.. can u also post the script for metadata of tables used ? </p>
<p>Last but not the least do u forsee any drawback using this technique ?</p>
<p>br<br />
atul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mette</title>
		<link>http://www.rittmanmead.com/2008/09/10/cube-rollup-grouping-sets-and-grouping-ids/comment-page-1/#comment-6365</link>
		<dc:creator>Mette</dc:creator>
		<pubDate>Tue, 16 Sep 2008 14:22:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.rittmanmead.com/2008/09/10/cube-rollup-grouping-sets-and-grouping-ids/#comment-6365</guid>
		<description>What is the SQL for getting the output of the figure with the explaination of the vector and the grouing ID&#039;s?

Is there a simple way of doing it ?  If you ie have a cube with 8 fields - it would be nice to just do the SQL and get the appropriate grouping id numbers.

Best regards
Mette</description>
		<content:encoded><![CDATA[<p>What is the SQL for getting the output of the figure with the explaination of the vector and the grouing ID&#8217;s?</p>
<p>Is there a simple way of doing it ?  If you ie have a cube with 8 fields &#8211; it would be nice to just do the SQL and get the appropriate grouping id numbers.</p>
<p>Best regards<br />
Mette</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Scott</title>
		<link>http://www.rittmanmead.com/2008/09/10/cube-rollup-grouping-sets-and-grouping-ids/comment-page-1/#comment-6343</link>
		<dc:creator>Peter Scott</dc:creator>
		<pubDate>Thu, 11 Sep 2008 09:48:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.rittmanmead.com/2008/09/10/cube-rollup-grouping-sets-and-grouping-ids/#comment-6343</guid>
		<description>The real utility is to create a single summary (aggregate) table and to use Materialized View Query rewrite to extract just the data of interest - just as in your final example. I prefer to use GROUPING SETS as it allows me to select the level combinations that I am going to materialize (and that means store) in to the aggregate table, after all, some combinations generated by cube or roll-up that are &#039;theoretically possible&#039; might not be &#039;business relevant&#039;.  Of course, creating a MView of multiple levels of aggregation requires storage in the database and time to refresh, but this still may be better than the alternative of creating individual summary MViews.

One tip - consider HASH (or LIST if you want a little extra work) partitioning (or sub-partitioning) on the grouping set id. Range partitioning on time might not be a good option if you included time in the roll-up - list partitioning is possible though but needs some effort in maintenance

If you have Oracle 11g Enterprise Edition with the OLAP option and only need simple SUM type measures (additive across all dimensions) you could also consider CUBE ORGANIZED MATERIALIZED VIEWS - here the OLAP cube is also presented to the data dictionary as a conventional m-view definition and hence accessible to rewrite. Interestingly, the query definition closely matches your GROUPING SET example.
The downside to the OLAP route is that is an extra-cost option over the database; the upside is that the cube need not be fully populated and potentially can save space over the fully populated tables you created in your examples.</description>
		<content:encoded><![CDATA[<p>The real utility is to create a single summary (aggregate) table and to use Materialized View Query rewrite to extract just the data of interest &#8211; just as in your final example. I prefer to use GROUPING SETS as it allows me to select the level combinations that I am going to materialize (and that means store) in to the aggregate table, after all, some combinations generated by cube or roll-up that are &#8216;theoretically possible&#8217; might not be &#8216;business relevant&#8217;.  Of course, creating a MView of multiple levels of aggregation requires storage in the database and time to refresh, but this still may be better than the alternative of creating individual summary MViews.</p>
<p>One tip &#8211; consider HASH (or LIST if you want a little extra work) partitioning (or sub-partitioning) on the grouping set id. Range partitioning on time might not be a good option if you included time in the roll-up &#8211; list partitioning is possible though but needs some effort in maintenance</p>
<p>If you have Oracle 11g Enterprise Edition with the OLAP option and only need simple SUM type measures (additive across all dimensions) you could also consider CUBE ORGANIZED MATERIALIZED VIEWS &#8211; here the OLAP cube is also presented to the data dictionary as a conventional m-view definition and hence accessible to rewrite. Interestingly, the query definition closely matches your GROUPING SET example.<br />
The downside to the OLAP route is that is an extra-cost option over the database; the upside is that the cube need not be fully populated and potentially can save space over the fully populated tables you created in your examples.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
