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

Optimize it through case study-- Partition Table Index

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Optimize it through case study-- Partition Table Index

Partition table index

Just like partitioned tables, partitioned indexes improve manageability, availability, performance, and scalability. They can either be partitioned independently (global indexes) or automatically linked to a table's partitioning method (local indexes). In general, you should use global indexes for OLTP applications and local indexes for data warehousing or DSS applications. Also, whenever possible, you should try to use local indexes because they are easier to manage. When deciding what kind of partitioned index to use, you should consider the following guidelines in order:

If the table partitioning column is a subset of the index keys, use a local index. If this is the case, you are finished. If this is not the case, continue to guideline 2.

If the index is unique, use a global index. If this is the case, you are finished. If this is not the case, continue to guideline 3.

If your priority is manageability, use a local index. If this is the case, you are finished. If this is not the case, continue to guideline 4.

If the application is an OLTP one and users need quick response times, use a global index. If the application is a DSS one and users are more interested in throughput, use a local index.

Local index local index

1. The local index must be a partitioned index, the partitioning key is equal to the partitioning key of the table, and the number of partitions is equal to the partitioning of the table. In a word, the partitioning mechanism of the local index is the same as that of the table.

two。 If the index column of a local index begins with a partitioning key, it is called a prefix local index.

3. If the column of a local index does not begin with a partition key, or does not contain a partition key column, it is called a non-prefix index.

4. Both prefix and non-prefix indexes can support index partition elimination as long as the condition of the query contains the index partition key.

5. The local index only supports the uniqueness within the partition, but cannot support the uniqueness on the table, so if you want to use the local index to constrain the uniqueness of the table, the partition key columns must be included in the constraint.

6. The local partition index is for a single partition, each partition index only points to one table partition, while the global index is not, a partition index can point to n table partitions, at the same time, a table partition may also point to n index partitions, doing truncate or move,shrink to a partition in the partition table, etc., may affect n global index partitions, because of this, the local partition index has higher availability.

7. Bitmap indexes can only be locally partitioned.

8. Local indexes are mostly used in data warehouse environment (OLAP).

Global index global index

1. The partition key and partition number of the global index and the partition key and partition number of the table may be different, and the partitioning mechanism of the table and the global index is different.

two。 The global index can be partitioned or unpartitioned, and the global index must be a prefix index, that is, the index column of the global index must have the index partitioning key as its first few columns.

3. The index entry of a global partitioned index may point to several partitions, so for a global partitioned index, even if you only move and truncate the data in one partition, you need to rebulid several partitions or even the whole index.

4. Global index is mostly used in OLTP system.

5. Global partitioning indexes are only partitioned by range or hash hash, and hash partitions are only supported after 10g.

6. When oracle9i move or truncate the partition table in the future, you can use the update global indexes statement to update the global partition index synchronously, consuming certain resources in exchange for a high degree of availability.

7. The table uses column an as the partition and refers to b as the local partition index. if b is used in the where condition, then oracle will scan the partitions of all tables and indexes, and the cost will be higher than the partition. At this time, you can consider using b as the global partition index.

Partition index dictionary

Summary statistics of DBA_PART_INDEXES partitioned indexes, you can know which partitioned indexes are on each table, and the new class of partitioned indexes (local/global,)

Partition-level statistics for each partition index of Dba_ind_partitions

Dba_indexesminusdba_part_indexes can find out which non-partitioned indexes are on each table.

Case study:

Partition index

1. Local prefix index (Local Index)

11:48:28 SYS@ test1 > create index part_id_ind on part_t1 (object_id) local;Index created.11:49:23 SYS@ test1 > select index_name, partitioning_type, partition_count from user_part_indexes11:49:53 2 where index_name='PART_ID_IND' INDEX_NAME PARTITION PARTITION_COUNT-- PART_ID_IND RANGE 511 SYS@ test1 53 SYS@ test1 > select index_name,PARTITION_NAME,STATUS TABLESPACE_NAME from user_ind_partitions11:54:47 2 where index_name='PART_ID_IND' INDEX_NAME PARTITION_NAME STATUS TABLESPACE_NAME -PART_ID_IND P1 USABLE TBS1PART_ID_IND P2 USABLE TBS2PART_ID_IND P3 USABLE TBS3PART_ID_IND P4 USABLE SYSTEMPART_ID_IND P5 USABLE SYSTEM11:54:59 SYS@ test1 > select table_name PARTITION_NAME, PARTITION_POSITION,TABLESPACE_NAME from dba_tab_partitions11:55:41 2 where table_name='PART_T1' TABLE_NAME PARTITION_NAME PARTITION_POSITION TABLESPACE_NAME -PART_T1 P1 11 TBS1PART_T1 P2 2 TBS2PART_T1 P3 3 TBS3PART_T1 P4 4 SYSTEMPART_T1 P5 5 SYSTEM11:56:18 SYS@ test1 > alter table part_t1 move partition p4 tablespace tbs4 Table altered.11:56:29 SYS@ test1 > alter table part_t1 move partition p5 tablespace tbs4;Table altered.11:56:43 SYS@ test1 > select table_name,PARTITION_NAME, PARTITION_POSITION,TABLESPACE_NAME from dba_tab_partitions11:56:51 2 where table_name='PART_T1' TABLE_NAME PARTITION_NAME PARTITION_POSITION TABLESPACE_NAME -PART_T1 P1 11 TBS1PART_T1 P2 2 TBS2PART_T1 P3 3 TBS3PART_T1 P4 4 TBS4PART_T1 P5 5 TBS411:56:55 SYS@ test1 > select index_name PARTITION_NAME,STATUS, TABLESPACE_NAME from user_ind_partitions11:57:04 2 where index_name='PART_ID_IND' INDEX_NAME PARTITION_NAME STATUS TABLESPACE_NAME -PART_ID_IND P1 USABLE TBS1PART_ID_IND P2 USABLE TBS2PART_ID_IND P3 USABLE TBS3PART_ID_IND P4 UNUSABLE SYSTEMPART_ID_IND P5 UNUSABLE SYSTEM11:58:31 SYS@ test1 > alter index PART_ID_IND rebuild partition p4 online Index altered.12:03:52 SYS@ test1 > select index_name,PARTITION_NAME,STATUS, TABLESPACE_NAME from user_ind_partitions12:03:59 2 where index_name='PART_ID_IND' INDEX_NAME PARTITION_NAME STATUS TABLESPACE_NAME -PART_ID_IND P1 USABLE TBS1PART_ID_IND P2 USABLE TBS2PART_ID_IND P3 USABLE TBS3PART_ID_IND P4 USABLE SYSTEMPART_ID_IND P5 UNUSABLE SYSTEM12:04:08 SYS@ test1 > alter index PART_ID_IND rebuild partition p4 online tablespace tbs4 Index altered.12:04:22 SYS@ test1 > alter index PART_ID_IND rebuild partition p5 online tablespace tbs4;Index altered.12:04:33 SYS@ test1 > select index_name,PARTITION_NAME,STATUS, TABLESPACE_NAME from user_ind_partitions12:04:39 2 where index_name='PART_ID_IND' INDEX_NAME PARTITION_NAME STATUS TABLESPACE_NAME -PART_ID_IND P1 USABLE TBS1PART_ID_IND P2 USABLE TBS2PART_ID_IND P3 USABLE TBS3PART_ID_IND P4 USABLE TBS4PART_ID_IND P5 USABLE TBS4

2. Local non-prefix index

13:26:27 SYS@ test1 > create index part_name_ind on part_t1 (object_name) local;Index created.13:27:13 SYS@ test1 > select index_name,PARTITION_NAME,STATUS, TABLESPACE_NAME from user_ind_partitions13:27:23 2 where index_name='PART_NAME_IND' INDEX_NAME PARTITION_NAME STATUS TABLESPACE_NAME -PART_NAME_IND P1 USABLE TBS1PART_NAME_IND P2 USABLE TBS2PART_NAME_IND P3 USABLE TBS3PART_NAME_IND P4 USABLE TBS4PART_NAME_IND P5 USABLE TBS4 13:29:00 SYS@ test1 > select * from part_t1 where object_name='EMP' OWNER--OBJECT_NAME- -OBJECT_ID OBJECT_TYPE TIMESTAMP STATUS--SCOTTEMP 14741 TABLE 2013-11-18 15 07 49 VALIDElapsed: 00:00:00.01Execution Plan---Plan hash value: 2894019794 Mui- -| Id | Operation | Name | Rows | Bytes | Cost (% CPU) | Time | Pstart | Pstop | |-| 0 | | | SELECT STATEMENT | | 1 | 123 | 7 (0) | 00:00:01 | | 1 | PARTITION RANGE ALL | | 1 | 123 | 7 (0) | 00:00:01 | 15 | | 2 | TABLE ACCESS BY LOCAL INDEX ROWID | PART_T1 | 1 | 123 | | 7 (0) | 00:00:01 | 15 | | * 3 | INDEX RANGE SCAN | PART_NAME_IND | 1 | | 6 (0) | 00:00:01 | 15 |-- -Predicate Information (identified by operation id):- -3-access ("OBJECT_NAME" = 'EMP') Note--dynamic sampling used for this statement (level=2) Statistics--- 0 recursive calls 0 db block gets 12 consistent gets 0 physical reads 0 redo size 779 bytes sent via SQL*Net to client 419 bytes received via SQL*Net from client 2 SQL*Net roundtrips to/from client 0 sorts (memory) 0 sorts (disk) 1 rows processed13:29:07 SYS@ test1 > 13:29:07 SYS@ test1 > SELECT * FROM PART_T1 where object_id=14741 OWNER--OBJECT_NAME- -OBJECT_ID OBJECT_TYPE TIMESTAMP STATUS--SCOTTEMP 14741 TABLE 2013-11-18 VALIDElapsed 15-07-49 VALIDElapsed: 00:00:00.00Execution Plan---Plan hash value: 3145656835- | Id | Operation | Name | Rows | Bytes | Cost (% CPU) | Time | Pstart | Pstop |- -| 0 | SELECT STATEMENT | | 1 | 1 | 123 | 2 (0) | 00:00:01 | | 1 | PARTITION RANGE SINGLE | | 1 | 123 | 2 (0) | 00:00:01 | 5 | 5 | | 2 | TABLE ACCESS BY LOCAL INDEX ROWID | PART_T1 | 1 | 123 | 2 ( 0) | 00:00:01 | 5 | 5 | | * 3 | INDEX RANGE SCAN | PART_ID_IND | 1 | | 1 (0) | 00:00:01 | 5 | 5 |- -Predicate Information (identified by operation id):- -3-access ("OBJECT_ID" = 14741) Note--dynamic sampling used for this statement (level=2) Statistics--- 0 recursive calls 0 db block gets 3 consistent gets 0 Physical reads 0 redo size 779 bytes sent via SQL*Net to client 419 bytes received via SQL*Net from client 2 SQL*Net roundtrips to/from client 0 sorts (memory) 0 sorts (disk) 1 rows processed

3. Global non-partitioned index (Global Index)

13:37:50 SYS@ test1 > create index part_name_gind on part_t1 (object_name) global 13:37:54 SYS@ test1 > select * from part_t1 where object_name='EMP' OWNER--OBJECT_NAME- -OBJECT_ID OBJECT_TYPE TIMESTAMP STATUS--SCOTTEMP 14741 TABLE 2013-11-18 15 07 49 VALIDElapsed: 00:00:00.00Execution Plan---Plan hash value: 201775 1627 -| Id | Operation | Name | Rows | Bytes | Cost (% CPU) | Time | Pstart | Pstop |- | | 0 | SELECT STATEMENT | | 1 | 123 | 2 (0) | 00:00:01 | | 1 | TABLE ACCESS BY GLOBAL INDEX ROWID | PART_T1 | 1 | 123 | 2 (0) | 00:00:01 | ROWID | ROWID | | * 2 | INDEX RANGE SCAN | PART_NAME_GIND | 1 | | | 1 (0) | 00:00:01 |- -Predicate Information (identified by operation id):-2-access ("OBJECT_NAME" = 'EMP') Note--dynamic sampling used for this statement (level=2) Statistics-- -44 recursive calls 0 db block gets 77 consistent gets 1 physical reads 0 redo size 783 bytes sent via SQL*Net to client 419 bytes received via SQL*Net from client 2 SQL*Net roundtrips to/from client 0 sorts (memory) 0 sorts (disk) 1 rows processed13:38:04 SYS@ test1 > / OWNER--OBJECT_NAME-- -OBJECT_ID OBJECT_TYPE TIMESTAMP STATUS-- -SCOTTEMP 14741 TABLE 2013-11-18 VALIDElapsed 15 VALIDElapsed: 00:00:00.00Execution Plan -Plan hash value: 2017751627- -| Id | Operation | Name | Rows | Bytes | Cost (% CPU) | Time | Pstart | Pstop |- -| 0 | SELECT STATEMENT | | 1 | 123 | 2 (0) | 00:00:01 | | 1 | TABLE ACCESS BY GLOBAL INDEX ROWID | PART_T1 | 1 | 123 | | | 2 (0) | 00:00:01 | ROWID | ROWID | | * 2 | INDEX RANGE SCAN | PART_NAME_GIND | 1 | | 1 (0) | 00:00:01 |-- | -Predicate Information (identified by operation id):- -2-access ("OBJECT_NAME" = 'EMP') Note--dynamic sampling used for this statement (level=2) Statistics--- 0 recursive calls 0 db block gets 4 consistent gets 0 physical reads 0 redo size 783 bytes sent via SQL*Net to client 419 bytes received via SQL*Net from client 2 SQL*Net roundtrips to/from client 0 sorts (memory) 0 sorts (disk) 1 rows processed13:38:24 SYS@ test1 > 13:40:01 SYS@ test1 > select index_name PARTITION_NAME,STATUS, TABLESPACE_NAME from user_ind_partitions13:40:03 2 where index_name='PART_NAME_GIND' No rows selected13:40:47 SYS@ test1 > SELECT INDEX_NAME,TABLESPACE_NAME,INDEX_TYPE FROM USER_INDEXES13:41:02 2 where index_name='PART_NAME_GIND' INDEX_NAME TABLESPACE_NAME INDEX_TYPE-- PART_NAME_GIND INDX NORMAL

4. Global partition index (can only be prefix)

13:43:36 SYS@ test1 > create index part_name_gind on part_t1 (object_name) global13:44:15 2 partition by hash (object_name) 13:44:19 3 partitions 413 global13:44:15 4423 4 store in (tbs1,tbs2,tbs3,tbs4); Index created.13:44:38 SYS@ test1 > select index_name,PARTITION_NAME,STATUS, TABLESPACE_NAME from user_ind_partitions13:45:31 2 where index_name='PART_NAME_GIND' INDEX_NAME PARTITION_NAME STATUS TABLESPACE_NAME -PART_NAME_GIND SYS_P61 USABLE TBS1PART_NAME_GIND SYS_P62 USABLE TBS2PART_NAME_GIND SYS_P63 USABLE TBS3PART_NAME_GIND SYS_P64 USABLE TBS413:45:41 SYS@ test1 > set autotrace on13:47:12 SYS@ test1 > select * from part_t1 where object_name='EMP' OWNER--OBJECT_NAME- -OBJECT_ID OBJECT_TYPE TIMESTAMP STATUS--SCOTTEMP 14741 TABLE 2013-11-18 VALIDElapsed 15-07-49 VALIDElapsed: 00:00:00.00Execution Plan---Plan hash value: 2733506516- -| Id | Operation | Name | Rows | Bytes | Cost (% CPU) | Time | | Pstart | Pstop |-| -| 0 | SELECT STATEMENT | | 1 | 123 | 2 (0) | 00:00:01 | | 1 | PARTITION HASH SINGLE | 1 | 123 | 2 (0) | 00:00:01 | 1 | 1 | 1 | 2 | TABLE ACCESS BY GLOBAL INDEX ROWID | PART_T1 | | 1 | 123 | 2 (0) | 00:00:01 | ROWID | ROWID | | * 3 | INDEX RANGE SCAN | PART_NAME_GIND | 1 | | 1 (0) | 00:00:01 | 1 | 1 |-| -Predicate Information (identified by operation id):- -3-access ("OBJECT_NAME" = 'EMP') Note--dynamic sampling used for this statement (level=2) Statistics--- 44 recursive calls 0 db block gets 80 consistent gets 1 physical reads 0 redo size 779 bytes sent via SQL*Net to client 419 bytes received via SQL*Net from client 2 SQL*Net roundtrips to/from client 0 sorts (memory) 0 sorts (disk) 1 rows processed13:47:29 SYS@ test1 > / OWNER- -OBJECT_NAME- -OBJECT_ID OBJECT_TYPE TIMESTAMP STATUS--SCOTTEMP 14741 TABLE 2013-11-18 VALIDElapsed: 00:00:00. 00Execution Plan---Plan hash value: 2733 506516 Murray- -| Id | Operation | Name | Rows | Bytes | Cost (% CPU) | Time | Pstart | Pstop |- -| 0 | SELECT STATEMENT | | | 1 | 123 | 2 (0) | 00:00:01 | | 1 | PARTITION HASH SINGLE | | 1 | 123 | 2 (0) | 00:00:01 | 1 | 1 | 1 | 2 | TABLE ACCESS BY GLOBAL INDEX ROWID | PART_T1 | 1 | 123 | 2 (0) | 00: 00:01 | ROWID | ROWID | | * 3 | INDEX RANGE SCAN | PART_NAME_GIND | 1 | | 1 (0) | 00:00:01 | 1 | 1 |-- -Predicate Information (identified by operation id):- 3-access ("OBJECT_NAME" = 'EMP') Note--dynamic sampling used for this statement (level=2) Statistics--- 0 recursive calls 0 db block gets 4 consistent gets 0 physical Reads 0 redo size 779 bytes sent via SQL*Net to client 419 bytes received via SQL*Net from client 2 SQL*Net roundtrips to/from client 0 sorts (memory) 0 sorts (disk) 1 rows processed

Partition table index maintenance

Global index maintenance:

When a partition is maintained, the global index is affected and 13:50:18 SYS@ test1 > alter table part_t1 move partition p1 tablespace tbs2 must be rebuilt 13:51:17 SYS@ test1 > select index_name,PARTITION_NAME,STATUS TABLESPACE_NAME from user_ind_partitions13:51:23 2 where index_name='PART_NAME_GIND'13:51:28 3 / INDEX_NAME PARTITION_NAME STATUS TABLESPACE_NAME -PART_NAME_GIND SYS_P61 UNUSABLE TBS1PART_NAME_GIND SYS_P62 UNUSABLE TBS2PART_NAME_GIND SYS_P63 UNUSABLE TBS3PART_NAME_GIND SYS_P64 UNUSABLE TBS413:51:31 SYS@ test1 > alter table part_t1 move partition p1 tablespace tbs1 Table altered.13:52:30 SYS@ test1 > select index_name,PARTITION_NAME,STATUS, TABLESPACE_NAME from user_ind_partitions13:52:35 2 where index_name='PART_NAME_GIND' INDEX_NAME PARTITION_NAME STATUS TABLESPACE_NAME -PART_NAME_GIND SYS_P61 UNUSABLE TBS1PART_NAME_GIND SYS_P62 UNUSABLE TBS2PART_NAME_GIND SYS_P63 UNUSABLE TBS3PART_NAME_GIND SYS_P64 UNUSABLE TBS4Elapsed: 00 SYS@ test1 00.0013 15 52 SYS@ test1 > 13:52:40 SYS@ test1 > alter index PART_NAME_GIND rebuild Alter index PART_NAME_GIND rebuild * ERROR at line 1:ORA-14086: a partitioned index may not be rebuilt as a wholeElapsed: 0000.0313 alter index PART_NAME_GIND rebuild 53 SYS@ test1 > alter index PART_NAME_GIND rebuild partition sys_p61;Index altered.Elapsed: 0000a partitioned index may not be rebuilt as a wholeElapsed 00.951353 SYS@ test1 > alter index PART_NAME_GIND rebuild partition sys_p62;Index altered.Elapsed: 0000VOL00.4213VOULY01 SYS@ test1 > alter index PART_NAME_GIND rebuild partition sys_p63 Index altered.Elapsed: 000.4913 SYS@ test1 00.4913 SYS@ test1 00.4913 SYS@ test1 07 SYS@ test1 > alter index PART_NAME_GIND rebuild partition sys_p64;Index altered.Elapsed: 0015 00.4213 SYS@ test1 > select index_name,PARTITION_NAME,STATUS, TABLESPACE_NAME from user_ind_partitions13:54:18 2 where index_name='PART_NAME_GIND' INDEX_NAME PARTITION_NAME STATUS TABLESPACE_NAME -PART_NAME_GIND SYS_P61 USABLE TBS1PART_NAME_GIND SYS_P62 USABLE TBS2PART_NAME_GIND SYS_P63 USABLE TBS3PART_NAME_GIND SYS_P64 USABLE TBS4Elapsed: 00:00:00.00

Local partition maintenance (Local):

When a partition is maintained, the local index, only the corresponding partition index is affected 13:56:08 SYS@ test1 > select index_name,PARTITION_NAME,STATUS, TABLESPACE_NAME from user_ind_partitions13:56:17 2 where index_name='PART_ID_IND' INDEX_NAME PARTITION_NAME STATUS TABLESPACE_NAME -PART_ID_IND P1 UNUSABLE TBS1PART_ID_IND P2 USABLE TBS2PART_ID_IND P3 USABLE TBS3PART_ID_IND P4 USABLE TBS4PART_ID_IND P5 USABLE TBS413:56:35 SYS@ test1 > ALTER INDEX PART_ID_IND rebuild partition p1 Index altered.Elapsed: 00 select index_name,PARTITION_NAME,STATUS 0015 00.5313 56 SYS@ test1 > select index_name,PARTITION_NAME,STATUS, TABLESPACE_NAME from user_ind_partitions13:57:04 2 where index_name='PART_ID_IND' INDEX_NAME PARTITION_NAME STATUS TABLESPACE_NAME -PART_ID_IND P1 USABLE TBS1PART_ID_IND P2 USABLE TBS2PART_ID_IND P3 USABLE TBS3PART_ID_IND P4 USABLE TBS4PART_ID_IND P5 USABLE TBS4

Update the global index when maintaining partitioned tables

14:04:25 SYS@ test1 > select index_name,PARTITION_NAME,STATUS, TABLESPACE_NAME from user_ind_partitions14:04:39 2 where index_name='PART_NAME_GIND' INDEX_NAME PARTITION_NAME STATUS TABLESPACE_NAME -PART_NAME_GIND SYS_P61 USABLE TBS1PART_NAME_GIND SYS_P62 USABLE TBS2PART_NAME_GIND SYS_P63 USABLE TBS3PART_NAME_GIND SYS_P64 USABLE TBS4Elapsed: 00 alter table part_t1 move partition 0015 00.0014 alter table part_t1 move partition 0414 alter table part_t1 move partition p1 tablespace tbs1 update global indexes Table altered.Elapsed: 00 select index_name,PARTITION_NAME,STATUS 0015 00.8014 select index_name,PARTITION_NAME,STATUS 0515 04 SYS@ test1, TABLESPACE_NAME from user_ind_partitions14:05:09 2 where index_name='PART_NAME_GIND' INDEX_NAME PARTITION_NAME STATUS TABLESPACE_NAME -PART_NAME_GIND SYS_P61 USABLE TBS1PART_NAME_GIND SYS_P62 USABLE TBS2PART_NAME_GIND SYS_P63 USABLE TBS3PART_NAME_GIND SYS_P64 USABLE TBS4

Local index requires manual rebuild

14:06:25 SYS@ test1 > alter index PART_ID_IND rebuild partition p1 * * Index altered.Elapsed: 0000 * 00.9014 * INDEX_NAME PARTITION_NAME STATUS TABLESPACE_NAME -PART_ID_IND P1 USABLE TBS1PART_ID_IND P2 USABLE TBS2PART_ID_IND P3 USABLE TBS3PART_ID_IND P4 USABLE TBS4PART_ID_IND P5 USABLE TBS4

Comparison of access between partitioned table and non-partitioned table

Access partition table: sql > create table part_t2 PARTITION BY RANGE (object_id) (partition p1 values less than (4000) tablespace tbs1, partition p2 values less than (8000) tablespace tbs2, partition p3 values less than (12000) tablespace tbs3, partition p4 values less than (maxvalue) tablespace tbs4) as select owner,object_name,object_id,object_type,TIMESTAMP,status from dba_objects 12:47:40 SYS@ test1 > set autotrac trace12:48:49 SYS@ test1 > select * from part_t2 where object_id

< 4000;3931 rows selected.Elapsed: 00:00:00.04Execution Plan----------------------------------------------------------Plan hash value: 1733007488--------------------------------------------------------------------------------------------------| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |--------------------------------------------------------------------------------------------------| 0 | SELECT STATEMENT | | 3931 | 472K| 12 (0)| 00:00:01 | | || 1 | PARTITION RANGE SINGLE| | 3931 | 472K| 12 (0)| 00:00:01 | 1 | 1 || 2 | TABLE ACCESS FULL | PART_T2 | 3931 | 472K| 12 (0)| 00:00:01 | 1 | 1 |--------------------------------------------------------------------------------------------------Note----- - dynamic sampling used for this statement (level=2)Statistics---------------------------------------------------------- 132 recursive calls 0 db block gets 361 consistent gets 6 physical reads 0 redo size 192675 bytes sent via SQL*Net to client 3301 bytes received via SQL*Net from client 264 SQL*Net roundtrips to/from client 0 sorts (memory) 0 sorts (disk) 3931 rows processed访问非分区表:12:50:29 SYS@ test1 >

Set autotrace trace12:51:06 SYS@ test1 > select * from dba_objects where object_id

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