Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

In-memory

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The Oracle 12c in memory option improves query performance by allocating independent memory areas (In Memory Area) in SGA and using column compression for data storage.

The size of the In Memory area is controlled by the parameter inmemory_size, which is a dynamic parameter.

The In Memory memory area can be divided into two subpools, which are 1m pool and 64K pool. 1m pool is used to store column data. 64K pool is used to store object metadata (metadata) and transaction log (transaction journal). The memory block allocated in 1m pool is an integral multiple of 1m, and the memory block size allocated in 64K pool is 64K.

The v$inmemory_area view has details for each pool size:

Click (here) to collapse or open

SQL > select pool, ALLOC_BYTES / 1024 k, used_bytes, POPULATE_STATUS, con_id from v$inmemory_area

POOL K USED_BYTES POPULATE_STATUS CON_ID

1MB POOL 37711872 0 DONE 3

64KB POOL 8633024 0 DONE 3

Elapsed: 00: 00: 00. 00

SQL > alter table testim inmemory; when the execution sets table to the inmemory property, no space is allocated in inmemory memory until the query loads the data.

After all, memory resources are more expensive and limited than disk or flash memory, so limited resources need to be allocated to more needed objects. Oracle added an INMEMORY attribute to control whether objects are loaded into the In Memory area, which can be defined at the tablespace, table, partition or even column level. Some specific use cases for setting the object IMMEMORY property are given in the Oracle In Memory white paper, which are excerpted here for future reference:

Alter tablespace testim default inmemory;alter table test inmemory no inmemory (prod_id); alter table test modify partition test_Q1_1998 no inmemory;alter table test inmemory memcompress for query low;-default

In addition, in order to control the loading order of objects, Oracle defines five priorities to achieve fine control, which are selected by the priority clause. The details are as follows:

1 * select SEGMENT_NAME,INMEMORY_SIZE,BYTES,POPULATE_STATUS from v$im_segments SEGMENT_NAME INMEMORY_SIZE BYTES POPULATE_STAT

TEST 14090240 99426304 COMPLETED

TESTIM 4653514752 4.6440E+10 COMPLETED

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report