在表上更新/刪除操作並不會將表放在 In-Memory 資料庫中 (文件 ID 2179002.1)
適用於:
Oracle Database - Enterprise Edition - 版本 12.1.0.2 和更高版本本文件所含資訊適用於所有平臺
目標
無論何時我們想放置表到 in-memory 中,我們需要訪問整個表以把表放入 in-memory。
這篇文件將提供資訊說明,一個表上更新/刪除語句將不會像查詢語句一樣把表放置到 in-memory 中。
解決方案
已經使用 In-Memory 的配置資訊:
SQL> show parameter inmemory
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
inmemory_clause_default string
inmemory_force string DEFAULT
inmemory_max_populate_servers integer 2
inmemory_query string ENABLE
inmemory_size big integer 200M
inmemory_trickle_repopulate_servers_ integer 1
percent
optimizer_inmemory_aware boolean TRUE
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
inmemory_clause_default string
inmemory_force string DEFAULT
inmemory_max_populate_servers integer 2
inmemory_query string ENABLE
inmemory_size big integer 200M
inmemory_trickle_repopulate_servers_ integer 1
percent
optimizer_inmemory_aware boolean TRUE
連線到 sales 使用者實施測試:
SQL> conn sh/oracle
Connected.
SQL> SELECT segment_name, inmemory_size, bytes FROM V$IM_SEGMENTS;
no rows selected
SQL> alter table times inmemory priority critical;
Table altered.
SQL> select TABLE_NAME,INMEMORY_PRIORITY,INMEMORY_DISTRIBUTE,INMEMORY_COMPRESSION from user_tables where table_name='TIMES';
TABLE_NAME INMEMORY INMEMORY_DISTRI INMEMORY_COMPRESS
------------------------- -------- --------------- -----------------
TIMES CRITICAL AUTO FOR QUERY LOW
SQL> SELECT segment_name, inmemory_size, bytes FROM V$IM_SEGMENTS;
no rows selected
SQL> update times times set END_OF_CAL_YEAR=sysdate;
1826 rows updated.
SQL> commit;
Commit complete.
SQL> SELECT segment_name, inmemory_size, bytes FROM V$IM_SEGMENTS;
no rows selected
Connected.
SQL> SELECT segment_name, inmemory_size, bytes FROM V$IM_SEGMENTS;
no rows selected
SQL> alter table times inmemory priority critical;
Table altered.
SQL> select TABLE_NAME,INMEMORY_PRIORITY,INMEMORY_DISTRIBUTE,INMEMORY_COMPRESSION from user_tables where table_name='TIMES';
TABLE_NAME INMEMORY INMEMORY_DISTRI INMEMORY_COMPRESS
------------------------- -------- --------------- -----------------
TIMES CRITICAL AUTO FOR QUERY LOW
SQL> SELECT segment_name, inmemory_size, bytes FROM V$IM_SEGMENTS;
no rows selected
SQL> update times times set END_OF_CAL_YEAR=sysdate;
1826 rows updated.
SQL> commit;
Commit complete.
SQL> SELECT segment_name, inmemory_size, bytes FROM V$IM_SEGMENTS;
no rows selected
上面的更新語句沒有把表放置到 in-memory:
用簡單查詢比較:
SQL> select count(*) from times;
COUNT(*)
----------
1826
1 row selected.
SQL> SELECT segment_name, inmemory_size, bytes FROM V$IM_SEGMENTS
SEGMENT_NAME INMEMORY_SIZE BYTES
------------------------------ ------------- ----------
TIMES 1179648 524288
1 row selected.
COUNT(*)
----------
1826
1 row selected.
SQL> SELECT segment_name, inmemory_size, bytes FROM V$IM_SEGMENTS
SEGMENT_NAME INMEMORY_SIZE BYTES
------------------------------ ------------- ----------
TIMES 1179648 524288
1 row selected.
上面的查詢語句把表放置到 in-memory 中。
透過上面的測試結果,我們可以看出更新/刪除語句不會把表放入到 in-memory 資料庫,除非我們訪問整個表的所有行。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31393455/viewspace-2129700/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MongoDB資料庫中更新與刪除資料MongoDB資料庫
- 【C/C++】資料庫刪除大表C++資料庫
- Yii 1.0資料庫操作 查詢、增加、更新、刪除資料庫
- SQL的資料庫操作:新增、更新、刪除、查詢SQL資料庫
- MySQL刪除資料表MySql
- PostgreSQL刪除表中重複資料SQL
- 如何對 ABAP 資料庫表透過 ABAP 程式碼進行更新和刪除操作試讀版資料庫
- MySQL資料庫表誤刪除恢復(一)MySql資料庫
- 如何刪除資料庫下的所有表(mysql)資料庫MySql
- Oracle中刪除表中的重複資料Oracle
- mysql 刪除表中重複的資料MySql
- python 刪除大表資料Python
- postgresql VACUUM 不會從表中刪除死行的三個原因SQL
- 當資料庫表無主鍵ID時,ORM這樣更新資料資料庫ORM
- MYSQL資料庫表記錄刪除解決方案MySql資料庫
- MySQL---資料刪除之後表檔案不變MySql
- SQL Server實戰二:建立、修改、複製、刪除資料庫表並加以資料處理SQLServer資料庫
- 為什麼刪除記錄表檔案不會減小?(記錄的插入與刪除在磁碟上的變化)
- 簡單介紹mysql如何刪除資料表和關聯的資料表刪除詳情MySql
- 在資料庫表中加一個狀態欄位可以代替軟刪除嗎?資料庫
- 【北亞資料恢復】誤刪除oracle表和誤刪除oracle表資料的資料恢復方法資料恢復Oracle
- MySQL超大表刪除資料過程MySql
- ORACLE刪除-表分割槽和資料Oracle
- sql 多表關聯刪除表資料SQL
- PG資料庫更新刪除卡死現象資料庫
- mysql 跨表查詢、更新、刪除示例MySql
- openGauss 更新表中資料
- [BUG反饋]刪除模型屬性時 不會刪除模型表的field_sort模型
- mysql資料庫誤刪除操作說明MySql資料庫
- oracle資料庫建立、刪除索引等操作Oracle資料庫索引
- hisql orm update表資料更新文件SQLORM
- 達夢資料庫如何將Excel表的資料複製到表中資料庫Excel
- 從資料庫中拿資料庫總是拿到上一條資料,還能拿到刪除的表的資料資料庫
- 刪除a表中和b表相同的資料
- PostgreSQL表增加/刪除欄位是否會重寫表SQL
- 一定要有密碼才能刪除資料庫的表嗎?密碼資料庫
- .NET 資料庫大資料 方案(插入、更新、刪除、查詢 、插入或更新)資料庫大資料
- 修改刪除表
- [資料庫][分庫分表]分庫分表之後,id主鍵如何處理資料庫