在表中创建索引在id上,和之前没创索引效果是一样的,select * from 表 where them=1 order by id;语句都得40多秒,
而同样的表在另外的用户下创建索引后就快多了,不知道什么原因
还有或者我创建散列分区在别地看到的都是和表一起创建的,问问我在表创建好之后,再添加分区的语句如何写,
alter table tabs add partition parts
Partition by hash(m_id)
(
Partition p1 tablespace cc1
Partition p2 tablespace cc2,
Partition p3 tablespace cc3,
Partition p4 tablespace cc4
);总说ORA-14020: this physical attribute may not be specified for a table partition;

解决方案 »

  1.   

    where them=1-- 所以根据你这个查询,应该在them字段创建索引,才有可能提高查询效率!
      

  2.   

    只能重新建表了
    create table tabs_new(m_id varchar2(10),name varchar2(20),...,)
    Partition by hash(m_id)
    (
    Partition p1 tablespace cc1
    Partition p2 tablespace cc2,
    Partition p3 tablespace cc3,
    Partition p4 tablespace cc4
    )insert into tabs_new select * from tabsrename tabs to tabs_old
    rename tabs_new to tabs
      

  3.   

    你索引确实不该加在ID上,把them设置为表中靠前的字段也比较好ORA-14020 this physical attribute may not be specified for a table partitionCause: Unexpected option was encountered while parsing physical attributes of a table
    partition; valid options for range or composite range partitions are INITRANS, MAXTRANS,
    TABLESPACE, STORAGE, PCTFREE, and PCTUSED; only TABLESPACE may be specified for hash
    partitions.Action: Remove invalid option(s) from the list of physical attributes of a table
    partition.