Andy Witkowski, Architect Thomas Kyte, VP Oracle Corporation.ppt
《Andy Witkowski, Architect Thomas Kyte, VP Oracle Corporation.ppt》由会员分享,可在线阅读,更多相关《Andy Witkowski, Architect Thomas Kyte, VP Oracle Corporation.ppt(65页珍藏版)》请在麦多课文档分享上搜索。
1、Andy Witkowski, Architect Thomas Kyte, VP Oracle Corporation,Oracle Database 10g SQL Model Clause,40166,Whats now in SQL for Modeling,Aggregation Enhancements Cube, Rollup, Grouping Sets New aggregates: Inverse Distribution, FIRST/LAST,etc Analytic Functions Window Functions: Rank, Moving, Cumulativ
2、e Statistical Functions: Correlation, Linear Regression,etc Old tools still have more modeling power than SQL Spreadsheets, MOLAP engines,SQL Model enhances SQL with modeling power,Case Study Modeling with Excel,Excel fits well at the personal scale UI and Formatting Calculations (build-in functions
3、, formulas) What-If analysis Excel fits poorly at corporate scale for modeling Cryptic row-column addressing No metadata, No standards, No mathematical model 100s of spreadsheets and consolidation by hand Does not scale (1000s formulas, TB of data) Perpetual data exchange: databases-Excel,Replace Ex
4、cel Modeling with SQL Modeling,Modeling with SQL Model,Language: Spreadsheet-like calculations in SQL Inter-row calculation. Treats relations as an N-Dim array Symbolic references to cells and their ranges Multiple Formulas over N-Dim arrays Automatic Formula Ordering Recursive Model Solving Model i
5、s a relation & can be processed further in SQL Multiple arrays with different dimensionality in one query Performance Parallel Processing in partitioning & formulas Multiple-self joins with one data access structure Multiple UNIONs with one data access structure Why Better? Automatic Consolidation (
6、models as views combine using SQL) Self Adjusting (as database changes no need to re-define) One version of truth (calc directly over data base, no exchange),SQL Model Concepts,Define Relation as Array,SELECT prod, time, s FROM sales,Relation,Array,1999,2000,2001,vcr,dvd,tv,pc,vcr 2001 9 dvd 2001 0,
7、prod,time,5 6 7 8,1 2 3 4,9 0 1 2,DIMENSION BY (prod, time) MEASURES (s),prod time s,Relation,DIMENSION BY (prod, time) MEASURES (s),Array,1999,2000,2001,vcr,dvd,tv,pc,prod,time,5 6 7 8,1 2 3 4,9 0 1 2,RULES UPSERT (sANY, 2000 = sCV(prod), CV(time) - 1 * 2,svcr, 2002 = svcr, 2001 + svcr, 2000,sdvd,
8、2002 =AVG(s) CV(prod), time2001 ),Sales in 2000 2x of previous year,Predict vcr sales in 2002,Predict dvd sales in 2002,vcr 2001 9 dvd 2001 0,prod time s,SELECT prod, time, s FROM sales,Define Business Rules,Relation,DIMENSION BY (prod, time) MEASURES (s),Array,1999,2000,2001,vcr,dvd,tv,pc,1 2 3 4,9
9、 0 1 2,RULES UPSERT (sANY, 2000 = sCV(prod), CV(time) - 1 * 2,svcr, 2002 = svcr, 2001 + svcr, 2000,sdvd, 2002 = AVG(s) CV(prod), time2001 ),Sales in 2000 2x of previous year,Predict vcr sales in 2002,Predict dvd sales in 2002,vcr 2001 9 dvd 2001 0,prod time s,SELECT prod, time, s FROM sales,2 4 6 8,
10、Evaluate Formulas 1st,Relation,DIMENSION BY (prod, time) MEASURES (s),1999,2000,2001,vcr,dvd,tv,pc,2002,2 4 6 8,1 2 3 4,9 0 1 2,11,vcr 2001 9 dvd 2001 0,prod time s,SELECT prod, time, s FROM sales,Sales in 2000 2x of previous year,Predict vcr sales in 2002,Predict dvd sales in 2002,Evaluate Formulas
11、 2nd,RULES UPSERT (sANY, 2000 = sCV(prod), CV(time) - 1 * 2,svcr, 2002 = svcr, 2001 + svcr, 2000,sdvd, 2002 = AVG(s) CV(prod), time2001 ),Relation,DIMENSION BY (prod, time) MEASURES (s),1999,2000,2001,vcr,dvd,tv,pc,2002,2 4 6 8,1 2 3 4,9 0 1 2,11 3,vcr 2001 9 dvd 2001 0,prod time s,SELECT prod, time
12、, s FROM sales,Sales in 2000 2x of previous year,Predict vcr sales in 2002,Predict dvd sales in 2002,RULES UPSERT (sANY, 2000 = sCV(prod), CV(time) - 1 * 2,svcr, 2002 = svcr, 2001 + svcr, 2000,sdvd, 2002 = AVG(s) CV(prod), time2001 ),Evaluate Formulas 3rd,Relation,DIMENSION BY (prod, time) MEASURES
13、(s),1999,2000,2001,vcr,dvd,tv,pc,2002,2 4 6 8,1 2 3 4,9 0 1 2,11 3,Relation again,vcr 2002 11 dvd 2002 3,vcr 2001 9 dvd 2001 0,Self-join.,join + UNION,join + UNION,vcr 2001 9 dvd 2001 0,prod time s,SELECT prod, time, s FROM sales,RULES UPSERT (sANY, 2000 = sCV(prod), CV(time) - 1 * 2,svcr, 2002 = sv
14、cr, 2001 + svcr, 2000,sdvd, 2002 = AVG(s) CV(prod), time2001 ),Return as Relation,Rows updated & inserted by the Model clause,Model Clause Components,Model clause,Key Concepts (1),New SQL Model Clause: Data as N-dim arrays with DIMENSIONS & MEASURES Data can be PARTITION-ed - creates an array per pa
15、rtition Formulas defined over the arrays express a (business) model Formulas within a Model: Use symbolic addressing using familiar array notation Can be ordered automatically based on dependency between cells Can be recursive with a convergence condition recursive models Can UPDATE or UPSERT cells
16、Support most SQL functions including aggregates,Key Concepts (2),Result of a SQL Model is a relation Can participate further in processing via joins, etc. Can define views containing Model computations SQL Model is the last query clause Executed after joins, aggregation, window functions Before ORDE
17、R BY Main Model and Reference Models Can relate models of different dimensionality,Formula Fundamentals (1),Formulas: SQL expressions over cells with aggs, functions, etc. Formula has a left and right side and represents assignment svcr, 2002 = svcr, 2001 + svcr, 2000 single ref svcr, 2002 = AVG(s)v
18、cr, t2002 multi ref on rightLeft side can qualify multiple cells sp IN (vcr,dvd), t2002 = 1000 multi ref on left sANY, t=2002 = 2 * sCV(p), CV(t)-1 left-right correlation sp IN (SELECT prod FROM prod_tb), 2000 = 1000 Formula can operate in update or upsert mode update svcr, 2002 = svcr, 2001 + svcr,
19、 2000 upsert svcr, 2002 = svcr, 2001 + svcr, 2000,Formula Fundamentals (2),Function CV(dimension) propagates values from left to the right side. In example, products in 2002 are sum of two previous years. sANY, 2002 = sCV(p), CV(t)-1 +sCV(p), CV(t) 2,Formula Fundamentals (2),Function CV(dimension) p
20、ropagates values from left to the right side. In example, products in 2002 are sum of two previous years. sANY, 2002 = sCV(p), CV(t) -1 + sCV(p), CV(t) 2Formula result can depend on processing order. Can specify order in each formula. E.g., shift by time: svcr, ANY ORDER BY t = svcr, CV(t) - 1,Formu
21、la Fundamentals (2),Function CV(dimension) propagates values from left to the right side. In example, products in 2002 are sum of two previous years. sANY, 2002 = sCV(p), CV(t) -1 + sCV(p), CV(t) 2Formula result can depend on processing order. Can specify order in each formula. E.g., shift by time:
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
2000 积分 0人已下载
下载 | 加入VIP,交流精品资源 |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- ANDYWITKOWSKI ARCHITECTTHOMASKYTE VPORACLECORPORATIONPPT

链接地址:http://www.mydoc123.com/p-378399.html