--中间表使用,不适用于最终表,否则可能影响查询计划
create table hxz_test_2 parallel(degree 4) nologging as select * from serv_t;--56.296
create index idx_hxz_test_2 on hxz_test_2(serv_id) parallel(degree 4) nologging;
--------------------------------------------------------------------------------------------
create index idx_hxz_test_2 on hxz_test_2(ioid_id0) /*parallel(degree 4)*/ nologging;--208.219
create index idx_hxz_test_3 on hxz_test_2(ioid_id0) parallel(degree 8) nologging;--30.344
--
select count(*) from hxz_t_s--67.875
alter table hxz_t_s parallel (degree 4)
select count(*) from hxz_t_s--14s
--
alter session enable parallel dml;
--并行的时候可以看到
小结:并行的实质是创建了多个session在后台执行同一任务
select * from v$px_session;
C000000183C756D0 42 4844 42
C000000183C71770 24 6105 42 4844 1 1 1 1 4 4
C000000185C86D88 82 7096 42 4844 1 1 1 2 4 4
C000000183C70CE0 21 12192 42 4844 1 1 1 3 4 4
C000000183C7E020 81 3063 42 4844 1 1 1 4 4 4[@more@]
create table hxz_test_2 parallel(degree 4) nologging as select * from serv_t;--56.296
create index idx_hxz_test_2 on hxz_test_2(serv_id) parallel(degree 4) nologging;
--------------------------------------------------------------------------------------------
create index idx_hxz_test_2 on hxz_test_2(ioid_id0) /*parallel(degree 4)*/ nologging;--208.219
create index idx_hxz_test_3 on hxz_test_2(ioid_id0) parallel(degree 8) nologging;--30.344
--
select count(*) from hxz_t_s--67.875
alter table hxz_t_s parallel (degree 4)
select count(*) from hxz_t_s--14s
--
alter session enable parallel dml;
--并行的时候可以看到
小结:并行的实质是创建了多个session在后台执行同一任务
select * from v$px_session;
C000000183C756D0 42 4844 42
C000000183C71770 24 6105 42 4844 1 1 1 1 4 4
C000000185C86D88 82 7096 42 4844 1 1 1 2 4 4
C000000183C70CE0 21 12192 42 4844 1 1 1 3 4 4
C000000183C7E020 81 3063 42 4844 1 1 1 4 4 4[@more@]
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/46907/viewspace-920774/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/46907/viewspace-920774/