系统是linux 6.4
Oracle版本12.1.0.2.0
SQL> r
1* select segment_name,inmemory from dba_segments where owner='SCOTT'
SEGMENT_NAME INMEMORY
-------------------- --------
OBJ2 DISABLED
OBJ DISABLED
SQL> select count(*) from obj;
COUNT(*)
----------
90165
Execution Plan
----------------------------------------------------------
Plan hash value: 1612036541
-------------------------------------------------------------------
| Id | Operation | Name | Rows | Cost (%CPU)| Time |
-------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 393 (1)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | | |
| 2 | TABLE ACCESS FULL| OBJ | 90165 | 393 (1)| 00:00:01 |
-------------------------------------------------------------------
Statistics
----------------------------------------------------------
11 recursive calls
0 db block gets
1420 consistent gets
1409 physical reads
0 redo size
544 bytes sent via SQL*Net to client
551 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
2 sorts (memory)
0 sorts (disk)
1 rows processed
SQL> alter table obj inmemory;
Table altered.
SQL> select segment_name,inmemory from dba_segments where owner='SCOTT';
SEGMENT_NAME INMEMORY
-------------------- --------
OBJ2 DISABLED
OBJ ENABLED
SQL> select count(*) from obj;
COUNT(*)
----------
90165
Execution Plan
----------------------------------------------------------
Plan hash value: 1612036541
----------------------------------------------------------------------------
| Id | Operation | Name | Rows | Cost (%CPU)| Time |
----------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 15 (0)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | | |
| 2 | TABLE ACCESS INMEMORY FULL| OBJ | 90165 | 15 (0)| 00:00:01 |
----------------------------------------------------------------------------
Statistics
----------------------------------------------------------
9 recursive calls
0 db block gets
1422 consistent gets
1409 physical reads
0 redo size
544 bytes sent via SQL*Net to client
551 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
2 sorts (memory)
0 sorts (disk)
1 rows processed
逻辑读和物理读都没减少