【问题标题】:Oracle: Creating an Index on a Table Containing Partitioned LOB ColumnsOracle:在包含分区 LOB 列的表上创建索引
【发布时间】:2016-11-07 08:33:11
【问题描述】:

我想在 Oracle DD 中创建索引(Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production) 从我读到的 Oracle 文档中,为了提高查询性能,我可以在分区 LOB 列上创建索引。例如:

CREATE INDEX index_name 
   ON table_name (LOB_column_1, LOB_column_2, ...) LOCAL;

我试过了

CREATE INDEX fullsearch_description ON T_DESCRIPTION (UPPER(text));

但我得到了一个错误:

错误

r starting at line : 1 in command -
CREATE INDEX fullsearch_description ON T_DESCRIPTION (UPPER(text))
Error at Command Line : 1 Column : 55
Error report -
SQL Error: ORA-02327: cannot create index on expression with datatype LOB
02327. 00000 -  "cannot create index on expression with datatype %s"
*Cause:    An attempt was made to create an index on a non-indexable
           expression.
*Action:   Change the column datatype or do not create the index on an
           expression whose datatype is one of  VARRAY, nested table, object,
           LOB, or  REF.

【问题讨论】:

    标签: sql oracle oracle11g


    【解决方案1】:

    您不能在 LOB 列上构建 B 树。 在您的case upper(lob) returns lob。并且 oracle 不能使用 lob 来建立索引。

    你可以使用这样的东西。因为函数索引的结果是 varchar2。但我认为这个解决方案没有用。

    CREATE INDEX fullsearch_description ON T_DESCRIPTION (UPPER(dbms_lob.substr(text,1,1000)));
    

    在 lob 列上,您可以使用域索引。 Database Data Cartridge - 有关于域索引的章节。以及如何实施。 (Using Extensible Indexing, Building Domain Indexes, Defining Operators, Extensible Indexing Interface ,Extensible Optimizer Interface) Oracle 提供了几种域索引的实现。 Oracle Text。 * 这些索引方法非常复杂。

    【讨论】:

      猜你喜欢
      • 2022-10-15
      • 1970-01-01
      • 2016-06-07
      • 1970-01-01
      • 1970-01-01
      • 2017-02-01
      • 2011-10-23
      • 2020-04-29
      • 2015-02-11
      相关资源
      最近更新 更多