12. 动态分区精简 www.oracledatabase12g.com www.oracledatabase12g.com www.oracledatabase12g.com www.oracledatabase12g.com www.oracledatabase12g.com www.oracledatabase12g.com 针对复杂查询存在高级精简的机制 在运行时递归 SQL 语句会自动找出相关分区 关注执行计划中的 PSTAR/PSTOP 字段中的 KEY SELECT sum(amount_sold) FROM sales s, times t WHERE t.time_id = s.time_id AND t.calendar_month_desc IN (‘MAR-04’,‘APR-04’,‘MAY-04’); Sales Table May 2004 June 2004 Jul 2004 Jan 2004 Feb 2004 Mar 2004 Apr 2004 Times Table
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26. Incremental Global Statistics www.oracledatabase12g.com Sales Table May 22 nd 2008 May 23 rd 2008 May 18 th 2008 May 19 th 2008 May 20 th 2008 May 21 st 2008 Sysaux Tablespace S1 S2 S3 S4 S5 S6 1. Partition level stats are gathered & synopsis created Global Statistic 2. Global stats generated by aggregati ng partition synopsis
27. Incremental Global Statistics Cont’d Sales Table May 24 th 2008 3. A new partition is added to the table & Data is Loaded www.oracledatabase12g.com May 22 nd 2008 May 23 rd 2008 May 18 th 2008 May 19 th 2008 May 20 th 2008 May 21 st 2008 Sysaux Tablespace May 24 th 2008 S7 4. Gather partition statistics for new partition S1 S2 S3 S4 S5 S6 5. Retrieve synopsis for each of the other partitions from Sysaux Global Statistic 6. Global stats generated by aggregati ng the original partition synopsis with the new one
28.
29.
30.
31.
32.
33.
Editor's Notes
Partitioning works by very simply splitting database objects into smaller chunks. Operations on the objects simply leave out the chunks they don’t require. There is absolutely no need to change the application in order to exploit this – and we have a huge variety of ways of partitioning the data to suit any type of data. Let’s go into the advantages in a little more detail.
Oracle DW users are universally leveraging partitioning and parallelism. Compression is heavily used, exploited in almost 90% of our survey participants. MVs and VPDs are widespread, touching over two thirds of survey sites.
Partitioning is incredibly well established and a very mature Oracle technology. We have more capability than any other database vendor – and have responded to different customer requirements over the years. Most recently, for example, we have introduced a partition advisor to help customers decide how to partition their tables.
Splitting database objects up also helps manageability. For example if we know that we have all the data for a certain partition, we can simply mark it as read only and we do not need to back it up ever again.
Splitting database objects up also helps manageability. For example if we know that we have all the data for a certain partition, we can simply mark it as read only and we do not need to back it up ever again.
Splitting database objects up also helps manageability. For example if we know that we have all the data for a certain partition, we can simply mark it as read only and we do not need to back it up ever again.
Partitioning gives us a benefit for availability. If a partition is removed from an object, the query can just run on the remainder of the table. This is great for maintenance and archival.
Splitting database objects up also helps manageability. For example if we know that we have all the data for a certain partition, we can simply mark it as read only and we do not need to back it up ever again.
Gathering statistics on one partition (e.g. after a bulk load) causes a full scan of all partitions to gather global table statistics Extremely time and resource intensive Use incremental statistics Gather statistics for touched partition(s) ONLY Table (global) statistics are built from partition statistics