[20201110]oracle建立索引nosrt.txt

来源:这里教程网 时间:2026-03-03 16:16:22 作者:

[20201110]oracle建立索引nosrt.txt --//被别人问的问题,实际上这个参数很无聊,仅仅在表排序的情况下减少排序操作,要求你表中数据已经有序的情况下。 1.环境: SCOTT@book> @ ver1 PORT_STRING                    VERSION        BANNER ------------------------------ -------------- -------------------------------------------------------------------------------- x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production 2.测试: SCOTT@book> create table t1 as select * from dba_objects; Table created. SCOTT@book> create index i_t1_object_id on t1(object_id) nosort ; create index i_t1_object_id on t1(object_id) nosort                                * ERROR at line 1: ORA-01409: NOSORT option may not be used; rows are not in ascending order --//表T1并没有按照object_id排序,建立索引时报错。 SCOTT@book> create table t2 as select * from dba_objects order by object_id; Table created. SCOTT@book> create index i_t2_object_id on t2(object_id) nosort ; Index created. --//表T2按照object_id排序,建立索引时OK。 --//除非你导入数据时按照该字段排序,建立的索引才有用。

相关推荐