clob欄位對於parallel dml的限制
今天發現包含clob欄位的表不能parallel insert
實驗如下:
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Productio
NLSRTL Version 10.2.0.4.0 - Production
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Productio
NLSRTL Version 10.2.0.4.0 - Production
5 rows selected.
SQL> create table test_lock (id number);
Table created.
SQL> alter session enable parallel dml;
Session altered.
SQL> explain plan for insert /*+ parallel(test_lock,4) */ into test_lock select object_id from user_objects;
Explained.
SQL> @s_xplan
執行計劃如下:
PLAN_TABLE_OUTPUT
----------------------------------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 640494208
PLAN_TABLE_OUTPUT
----------------------------------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 640494208
----------------------------------------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | TQ |IN-OUT| PQ Distrib |
----------------------------------------------------------------------------------------------------------------------------------
| 0 | INSERT STATEMENT | | 5307 | 68991 | 1792 (2)| 00:00:22 | | | |
| 1 | PX COORDINATOR | | | | | | | | |
| 2 | PX SEND QC (RANDOM) | :TQ10001 | 5307 | 68991 | 1792 (2)| 00:00:22 | Q1,01 | P->S | QC (RAND) |
| 3 | LOAD AS SELECT | TEST_LOCK | | | | | Q1,01 | PCWP | |
| 4 | BUFFER SORT | | | | | | Q1,01 | PCWC | |
| 5 | PX RECEIVE | | 5307 | 68991 | 1792 (2)| 00:00:22 | Q1,01 | PCWP | |
| 6 | PX SEND ROUND-ROBIN | :TQ10000 | 5307 | 68991 | 1792 (2)| 00:00:22 | | S->P | RND-ROBIN |
| 7 | VIEW | USER_OBJECTS | 5307 | 68991 | 1792 (2)| 00:00:22 | | | |
| 8 | UNION-ALL | | | | | | | | |
|* 9 | FILTER | | | | | | | | |
|* 10 | TABLE ACCESS FULL | OBJ$ | 6197 | 205K| 1790 (2)| 00:00:22 | | | |
|* 11 | TABLE ACCESS BY INDEX ROWID| IND$ | 1 | 9 | 2 (0)| 00:00:01 | | | |
|* 12 | INDEX UNIQUE SCAN | I_IND1 | 1 | | 1 (0)| 00:00:01 | | | |
|* 13 | INDEX RANGE SCAN | I_LINK1 | 8 | 32 | 2 (0)| 00:00:01 | | | |
----------------------------------------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | TQ |IN-OUT| PQ Distrib |
----------------------------------------------------------------------------------------------------------------------------------
| 0 | INSERT STATEMENT | | 5307 | 68991 | 1792 (2)| 00:00:22 | | | |
| 1 | PX COORDINATOR | | | | | | | | |
| 2 | PX SEND QC (RANDOM) | :TQ10001 | 5307 | 68991 | 1792 (2)| 00:00:22 | Q1,01 | P->S | QC (RAND) |
| 3 | LOAD AS SELECT | TEST_LOCK | | | | | Q1,01 | PCWP | |
| 4 | BUFFER SORT | | | | | | Q1,01 | PCWC | |
| 5 | PX RECEIVE | | 5307 | 68991 | 1792 (2)| 00:00:22 | Q1,01 | PCWP | |
| 6 | PX SEND ROUND-ROBIN | :TQ10000 | 5307 | 68991 | 1792 (2)| 00:00:22 | | S->P | RND-ROBIN |
| 7 | VIEW | USER_OBJECTS | 5307 | 68991 | 1792 (2)| 00:00:22 | | | |
| 8 | UNION-ALL | | | | | | | | |
|* 9 | FILTER | | | | | | | | |
|* 10 | TABLE ACCESS FULL | OBJ$ | 6197 | 205K| 1790 (2)| 00:00:22 | | | |
|* 11 | TABLE ACCESS BY INDEX ROWID| IND$ | 1 | 9 | 2 (0)| 00:00:01 | | | |
|* 12 | INDEX UNIQUE SCAN | I_IND1 | 1 | | 1 (0)| 00:00:01 | | | |
|* 13 | INDEX RANGE SCAN | I_LINK1 | 8 | 32 | 2 (0)| 00:00:01 | | | |
----------------------------------------------------------------------------------------------------------------------------------
SQL>
SQL> alter table test_lock add text clob;
Table altered.
SQL> explain plan for insert /*+ parallel(test_lock,4) */ into test_lock (id) select object_id from user_objects;
Explained.
SQL> @s_xplan
執行計劃如下:
PLAN_TABLE_OUTPUT
-------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 2452769860
PLAN_TABLE_OUTPUT
-------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 2452769860
-----------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
-----------------------------------------------------------------------------------------------
| 0 | INSERT STATEMENT | | 5307 | 68991 | 1792 (2)| 00:00:22 |
| 1 | VIEW | USER_OBJECTS | 5307 | 68991 | 1792 (2)| 00:00:22 |
| 2 | UNION-ALL | | | | | |
|* 3 | FILTER | | | | | |
|* 4 | TABLE ACCESS FULL | OBJ$ | 6197 | 205K| 1790 (2)| 00:00:22 |
|* 5 | TABLE ACCESS BY INDEX ROWID| IND$ | 1 | 9 | 2 (0)| 00:00:01 |
|* 6 | INDEX UNIQUE SCAN | I_IND1 | 1 | | 1 (0)| 00:00:01 |
|* 7 | INDEX RANGE SCAN | I_LINK1 | 8 | 32 | 2 (0)| 00:00:01 |
-----------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
-----------------------------------------------------------------------------------------------
| 0 | INSERT STATEMENT | | 5307 | 68991 | 1792 (2)| 00:00:22 |
| 1 | VIEW | USER_OBJECTS | 5307 | 68991 | 1792 (2)| 00:00:22 |
| 2 | UNION-ALL | | | | | |
|* 3 | FILTER | | | | | |
|* 4 | TABLE ACCESS FULL | OBJ$ | 6197 | 205K| 1790 (2)| 00:00:22 |
|* 5 | TABLE ACCESS BY INDEX ROWID| IND$ | 1 | 9 | 2 (0)| 00:00:01 |
|* 6 | INDEX UNIQUE SCAN | I_IND1 | 1 | | 1 (0)| 00:00:01 |
|* 7 | INDEX RANGE SCAN | I_LINK1 | 8 | 32 | 2 (0)| 00:00:01 |
-----------------------------------------------------------------------------------------------
SQL>
計劃中沒有px了.
SQL> explain plan for update /*+ parallel(test_lock,4) */ test_lock set id = id+100;
Explained.
SQL> @s_xplan
執行計劃如下:
PLAN_TABLE_OUTPUT
---------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 3152912665
PLAN_TABLE_OUTPUT
---------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 3152912665
----------------------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | TQ |IN-OUT| PQ Distrib |
----------------------------------------------------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 30 | 390 | 3 (0)| 00:00:01 | | | |
| 1 | PX COORDINATOR | | | | | | | | |
| 2 | PX SEND QC (RANDOM) | :TQ10000 | 30 | 390 | 3 (0)| 00:00:01 | Q1,00 | P->S | QC (RAND) |
| 3 | UPDATE | TEST_LOCK | | | | | Q1,00 | PCWP | |
| 4 | PX BLOCK ITERATOR | | 30 | 390 | 3 (0)| 00:00:01 | Q1,00 | PCWC | |
| 5 | TABLE ACCESS FULL| TEST_LOCK | 30 | 390 | 3 (0)| 00:00:01 | Q1,00 | PCWP | |
----------------------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | TQ |IN-OUT| PQ Distrib |
----------------------------------------------------------------------------------------------------------------
| 0 | UPDATE STATEMENT | | 30 | 390 | 3 (0)| 00:00:01 | | | |
| 1 | PX COORDINATOR | | | | | | | | |
| 2 | PX SEND QC (RANDOM) | :TQ10000 | 30 | 390 | 3 (0)| 00:00:01 | Q1,00 | P->S | QC (RAND) |
| 3 | UPDATE | TEST_LOCK | | | | | Q1,00 | PCWP | |
| 4 | PX BLOCK ITERATOR | | 30 | 390 | 3 (0)| 00:00:01 | Q1,00 | PCWC | |
| 5 | TABLE ACCESS FULL| TEST_LOCK | 30 | 390 | 3 (0)| 00:00:01 | Q1,00 | PCWP | |
----------------------------------------------------------------------------------------------------------------
是可以parallel.注意這時test_lock是有clob欄位的.
總結:一個表是否可以進行paralle dml是有很多限制的,這種限制需要大家來總結.
從上面實驗可以看到:
對於有clob欄位的表:parallel insert 是禁止的;parallel update 確是可以的.(我想對於blob應該也時一樣的)
從上面實驗可以看到:
對於有clob欄位的表:parallel insert 是禁止的;parallel update 確是可以的.(我想對於blob應該也時一樣的)
另外:
<>的書中提到:對於Delete\update\Merge的操作,只有操作的物件是分割槽表時,Oracle才會啟用並行操作.
通過上面的測試後,parallel update 對於普通的表也時可以並行的.
<>的書中提到:對於Delete\update\Merge的操作,只有操作的物件是分割槽表時,Oracle才會啟用並行操作.
通過上面的測試後,parallel update 對於普通的表也時可以並行的.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/195110/viewspace-745353/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- clob欄位對於parallel ddl的限制Parallel
- clob 欄位查詢
- Parallel DMLParallel
- JDBC處理包含CLOB欄位JDBC
- BLOB及CLOB欄位處理
- Oracle Parallel DMLOracleParallel
- oracle clob欄位去除html標籤OracleHTML
- PL/SQL 插入clob欄位處理SQL
- 利用PLSQL包載入CLOB欄位SQL
- 如何在Clob欄位中查詢
- LONG欄位型別向CLOB遷移型別
- 【MySql】mysql 欄位個數的限制MySql
- [20130301]clob欄位的empty_clob與NULL.txtNull
- 在sqlplus全部輸出clob欄位的內容SQL
- MySQL的欄位數量以及長度限制MySql
- 表存在Clob、Blob欄位,dblink報錯的解決辦法
- 不確定的資料結構試驗clob欄位儲存資料結構
- 巧用欄位對映實現指定欄位的搜尋
- alter session enable parallel dml 使DML語句並行執行SessionParallel並行
- SQL Server中text型別匯入oracle clob欄位時的設定SQLServer型別Oracle
- 日誌挖掘-對於DML操作的挖掘
- 使用dbms_parallel_execute來完成DML的並行Parallel並行
- 關於SQL Server通過OLEDB訪問ORACLE資料表涉及CLOB或BLOB欄位的錯誤提示SQLServerOracle
- laravel-query-builder 對於欄位 值為 null的排序方式LaravelUINull排序
- 新增欄位對SQL的影響SQL
- [20130106]關於不同字符集下clob欄位的儲存問題.txt
- 簡單介紹2種Java讀取Oracle大欄位資料(CLOB)的方法JavaOracle
- Oracle連線檢視DML操作的限制Oracle
- 如何將varchar2修改為clob型別欄位(使用long過渡)型別
- 【實驗】【SQL*Loader】使用SQLLDR將資料載入到CLOB欄位SQL
- SQLServer索引優化(1):對於有order by欄位的建索引策略SQLServer索引優化
- 換ojdbc14.jar驅動後clob欄位後臺報異常的解決JDBCJAR
- redis對hash欄位加鎖Redis
- 欄位長度前後端是否都需要做限制?後端
- 將多個JSON欄位對映到單個Java欄位JSONJava
- VLDB and Partitioning Guide -- Chapter 8 Parallel DML NotesGUIIDEAPTParallel
- 關於Oracle的BLOB和CLOBOracle
- 【解決方案】Oracle插入/更新CLOB欄位報ORA-01704:字串文字太長Oracle字串