1 WITH 2 t01 AS 3 ( 4 SELECT 5 SUBSTR(starting_date,1,6) AS month 6 ,CASE 7 WHEN SUBSTR(starting_date,5,2) BETWEEN '04' AND '06' THEN 'Q1' 8 WHEN SUBSTR(starting_date,5,2) BETWEEN '07' AND '09' THEN 'Q2' 9 WHEN SUBSTR(starting_date,5,2) BETWEEN '10' AND '12' THEN 'Q3' 10 WHEN SUBSTR(starting_date,5,2) BETWEEN '01' AND '03' THEN 'Q4' 11 END AS quarter 12 ,shop_code 13 ,SUM(sales_figure) as sales_figure 14 FROM 15 test2 16 WHERE 17 starting_date BETWEEN '20110101' AND '20110331' 18 GROUP BY 19 SUBSTR(starting_date,1,6) 20 ,SUBSTR(starting_date,5,2) 21 ,shop_code 22 ), 23 t02 AS 24 ( 25 SELECT 26 month 27 ,quarter 28 ,shop_code 29 ,sales_figure 30 FROM 31 t01 32 WHERE 33 month BETWEEN '201101' AND '201103' 34 AND shop_code = '1000' 35 ) 36 SELECT /*+ PARALLEL */ 37 month 38 ,shop_code 39 ,sales_figure 40 FROM 41 ( 42 SELECT 43 month 44 ,shop_code 45 ,SUM(sales_figure) AS sales_figure 46 FROM 47 t02 48 GROUP BY 49 month 50 ,shop_code 51 UNION ALL 52 SELECT 53 quarter AS month 54 ,shop_code 55 ,SUM(sales_figure) AS sales_figure 56 FROM 57 t02 58 GROUP BY 59 quarter 60 ,shop_code 61 UNION ALL 62 SELECT 63 month 64 ,'ALL ' AS shop_code 65 ,SUM(sales_figure) AS sales_figure 66 FROM 67 t01 68 GROUP BY 69 month 70 UNION ALL 71 SELECT 72 quarter AS month 73 ,'ALL ' AS shop_code 74 ,SUM(sales_figure) AS salles_figure 75 FROM 76 t01 77 GROUP BY 78 quarter 79 ) 80 ORDER BY 81 month 82* ,shop_code
8行が選択されました。
経過: 00:00:02.98
実行計画 ---------------------------------------------------------- Plan hash value: 1065177875
------------------------------------------------------------------------------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop | TQ |IN-OUT| PQ Distrib | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 3692 | 118K| 5787 (2)| 00:01:10 | | | | | | | 1 | TEMP TABLE TRANSFORMATION | | | | | | | | | | | | 2 | PX COORDINATOR | | | | | | | | | | | | 3 | PX SEND QC (RANDOM) | :TQ10001 | 17550 | 411K| 5772 (2)| 00:01:10 | | | Q1,01 | P->S | QC (RAND) | | 4 | LOAD AS SELECT | SYS_TEMP_0FD9D6626_4A53712A | | | | | | | Q1,01 | PCWP | | | 5 | HASH GROUP BY | | 17550 | 411K| 5772 (2)| 00:01:10 | | | Q1,01 | PCWP | | | 6 | PX RECEIVE | | 17550 | 411K| 5772 (2)| 00:01:10 | | | Q1,01 | PCWP | | | 7 | PX SEND HASH | :TQ10000 | 17550 | 411K| 5772 (2)| 00:01:10 | | | Q1,00 | P->P | HASH | | 8 | HASH GROUP BY | | 17550 | 411K| 5772 (2)| 00:01:10 | | | Q1,00 | PCWP | | | 9 | PX BLOCK ITERATOR | | 394K| 9242K| 5770 (2)| 00:01:10 | 1 | 4 | Q1,00 | PCWC | | |* 10 | TABLE ACCESS FULL | TEST2 | 394K| 9242K| 5770 (2)| 00:01:10 | 1 | 4 | Q1,00 | PCWP | | | 11 | PX COORDINATOR | | | | | | | | | | | | 12 | PX SEND QC (RANDOM) | :TQ20000 | 17550 | 497K| 2 (0)| 00:00:01 | | | Q2,00 | P->S | QC (RAND) | | 13 | LOAD AS SELECT | SYS_TEMP_0FD9D6627_4A53712A | | | | | | | Q2,00 | PCWP | | |* 14 | VIEW | | 17550 | 497K| 2 (0)| 00:00:01 | | | Q2,00 | PCWP | | | 15 | PX BLOCK ITERATOR | | 17550 | 411K| 2 (0)| 00:00:01 | | | Q2,00 | PCWC | | | 16 | TABLE ACCESS FULL | SYS_TEMP_0FD9D6626_4A53712A | 17550 | 411K| 2 (0)| 00:00:01 | | | Q2,00 | PCWP | | | 17 | PX COORDINATOR | | | | | | | | | | | | 18 | PX SEND QC (ORDER) | :TQ30005 | 3692 | 118K| 13 (39)| 00:00:01 | | | Q3,05 | P->S | QC (ORDER) | | 19 | SORT ORDER BY | | 3692 | 118K| 13 (39)| 00:00:01 | | | Q3,05 | PCWP | | | 20 | PX RECEIVE | | 3692 | 118K| 12 (34)| 00:00:01 | | | Q3,05 | PCWP | | | 21 | PX SEND RANGE | :TQ30004 | 3692 | 118K| 12 (34)| 00:00:01 | | | Q3,04 | P->P | RANGE | | 22 | BUFFER SORT | | 3692 | 118K| | | | | Q3,04 | PCWP | | | 23 | VIEW | | 3692 | 118K| 12 (34)| 00:00:01 | | | Q3,04 | PCWP | | | 24 | UNION-ALL | | | | | | | | Q3,04 | PCWP | | | 25 | HASH GROUP BY | | 2758 | 68950 | 3 (34)| 00:00:01 | | | Q3,04 | PCWP | | | 26 | PX RECEIVE | | 2758 | 68950 | 3 (34)| 00:00:01 | | | Q3,04 | PCWP | | | 27 | PX SEND HASH | :TQ30000 | 2758 | 68950 | 3 (34)| 00:00:01 | | | Q3,00 | P->P | HASH | | 28 | HASH GROUP BY | | 2758 | 68950 | 3 (34)| 00:00:01 | | | Q3,00 | PCWP | | | 29 | VIEW | | 17550 | 428K| 2 (0)| 00:00:01 | | | Q3,00 | PCWP | | | 30 | PX BLOCK ITERATOR | | 17550 | 497K| 2 (0)| 00:00:01 | | | Q3,00 | PCWC | | | 31 | TABLE ACCESS FULL | SYS_TEMP_0FD9D6627_4A53712A | 17550 | 497K| 2 (0)| 00:00:01 | | | Q3,00 | PCWP | | | 32 | HASH GROUP BY | | 920 | 20240 | 3 (34)| 00:00:01 | | | Q3,04 | PCWP | | | 33 | PX RECEIVE | | 920 | 20240 | 3 (34)| 00:00:01 | | | Q3,04 | PCWP | | | 34 | PX SEND HASH | :TQ30001 | 920 | 20240 | 3 (34)| 00:00:01 | | | Q3,01 | P->P | HASH | | 35 | HASH GROUP BY | | 920 | 20240 | 3 (34)| 00:00:01 | | | Q3,01 | PCWP | | | 36 | VIEW | | 17550 | 377K| 2 (0)| 00:00:01 | | | Q3,01 | PCWP | | | 37 | PX BLOCK ITERATOR | | 17550 | 497K| 2 (0)| 00:00:01 | | | Q3,01 | PCWC | | | 38 | TABLE ACCESS FULL | SYS_TEMP_0FD9D6627_4A53712A | 17550 | 497K| 2 (0)| 00:00:01 | | | Q3,01 | PCWP | | | 39 | HASH GROUP BY | | 13 | 260 | 3 (34)| 00:00:01 | | | Q3,04 | PCWP | | | 40 | PX RECEIVE | | 13 | 260 | 3 (34)| 00:00:01 | | | Q3,04 | PCWP | | | 41 | PX SEND HASH | :TQ30002 | 13 | 260 | 3 (34)| 00:00:01 | | | Q3,02 | P->P | HASH | | 42 | HASH GROUP BY | | 13 | 260 | 3 (34)| 00:00:01 | | | Q3,02 | PCWP | | | 43 | VIEW | | 17550 | 342K| 2 (0)| 00:00:01 | | | Q3,02 | PCWP | | | 44 | PX BLOCK ITERATOR | | 17550 | 411K| 2 (0)| 00:00:01 | | | Q3,02 | PCWC | | | 45 | TABLE ACCESS FULL | SYS_TEMP_0FD9D6626_4A53712A | 17550 | 411K| 2 (0)| 00:00:01 | | | Q3,02 | PCWP | | | 46 | HASH GROUP BY | | 1 | 17 | 3 (34)| 00:00:01 | | | Q3,04 | PCWP | | | 47 | PX RECEIVE | | 1 | 17 | 3 (34)| 00:00:01 | | | Q3,04 | PCWP | | | 48 | PX SEND HASH | :TQ30003 | 1 | 17 | 3 (34)| 00:00:01 | | | Q3,03 | P->P | HASH | | 49 | HASH GROUP BY | | 1 | 17 | 3 (34)| 00:00:01 | | | Q3,03 | PCWP | | | 50 | VIEW | | 17550 | 291K| 2 (0)| 00:00:01 | | | Q3,03 | PCWP | | | 51 | PX BLOCK ITERATOR | | 17550 | 411K| 2 (0)| 00:00:01 | | | Q3,03 | PCWC | | | 52 | TABLE ACCESS FULL | SYS_TEMP_0FD9D6626_4A53712A | 17550 | 411K| 2 (0)| 00:00:01 | | | Q3,03 | PCWP | | -------------------------------------------------------------------------------------------------------------------------------------------------------------
Predicate Information (identified by operation id): ---------------------------------------------------
10 - filter("STARTING_DATE"<='20110331' AND SUBSTR("STARTING_DATE",1,6)<='201103' AND SUBSTR("STARTING_DATE",1,6)>='201101' AND "STARTING_DATE">='20110101') 14 - filter("MONTH">='201101' AND "MONTH"<='201103' AND "SHOP_CODE"='1000')
Note ----- - automatic DOP: Computed Degree of Parallelism is 16
統計 ---------------------------------------------------------- 348 recursive calls 5435 db block gets 318993 consistent gets 309118 physical reads 310176 redo size 875 bytes sent via SQL*Net to client 519 bytes received via SQL*Net from client 2 SQL*Net roundtrips to/from client 33 sorts (memory) 0 sorts (disk) 8 rows processed
04:31:33 SCOTT>
|
最近のコメント