Search notes:

Oracle SQL Plan operation: LOAD AS SELECT (TEMP SEGMENT MERGE)

create table tq84_range_partition (
   id   number,
   grp  varchar2(1) not null check (grp in ('A', 'B', 'C', 'D', 'E')),
   val  number
)
partition by range (grp) (
   partition tq84_range_partition_A  values less than ('B'),
   partition tq84_range_partition_B  values less than ('C'),
   partition tq84_range_partition_C  values less than ('D'),
   partition tq84_range_partition_D  values less than ('E'),
   partition tq84_range_partition_E  values less than ( maxvalue )
);
 
begin
   dbms_random.seed(2808);
  
   insert into tq84_range_partition
   select
      level,
      chr(ascii('A') + mod(level, 5)),
      dbms_random.value(100, 99999)
   from
      dual connect by level <= 1000 * 1000;
 
   dbms_stats.gather_table_stats(user, 'tq84_range_partition');
-- commit;
end;
/
 
explain plan for
with
  abc as (
     select /*+ materialize */
        grp
        val
     from
        tq84_range_partition
     where
        grp in ('D', 'A')
)
select /*+ parallel */
   *
from
   abc;
 
 
select * from dbms_xplan.display(format => 'basic')
--
-- -----------------------------------------------------------------------------
-- | Id  | Operation                              | Name                       |
-- -----------------------------------------------------------------------------
-- |   0 | SELECT STATEMENT                       |                            |
-- |   1 |  TEMP TABLE TRANSFORMATION             |                            |
-- |   2 |   PX COORDINATOR                       |                            |
-- |   3 |    PX SEND QC (RANDOM)                 | :TQ10000                   |
-- |   4 |     LOAD AS SELECT (TEMP SEGMENT MERGE)| SYS_TEMP_0FD9D66B8_E3058F9 |
-- |   5 |      PX BLOCK ITERATOR                 |                            |
-- |   6 |       TABLE ACCESS FULL                | TQ84_RANGE_PARTITION       |
-- |   7 |   PX COORDINATOR                       |                            |
-- |   8 |    PX SEND QC (RANDOM)                 | :TQ20000                   |
-- |   9 |     VIEW                               |                            |
-- |  10 |      PX BLOCK ITERATOR                 |                            |
-- |  11 |       TABLE ACCESS FULL                | SYS_TEMP_0FD9D66B8_E3058F9 |
-- -----------------------------------------------------------------------------
 
 
drop table tq84_range_partition;

See also

Plan operations such as LOAD AS SELECT (HYBRID TSM/HWMB).

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758199876, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/SQL/statement/execution/plan/operations/load/as-select/temp-segment-merge(101): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78