关于索引

1、创建索引

-- Create/Recreate indexes
create index ix_tablename_column on table_name(column)
  tablespace  name_SPACE
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 4M
    minextents 1
    maxextents unlimited
  );

 

2、SQL语句中利用索引排序:
select *  from table(INDEX=index_name) order by id,name;
这里需要指定ORDER BY语句才行。单独使用ORDER BY(不使用INDEX)的话,SQL不会自动使用索引,速度会很慢;

3、Oracle中,一个where里面只会用到一个索引;

 

你可能感兴趣的:(oracle,sql)