关于全文索引优化ctx_ddl.optimize_index很慢的问题
我的表 有17W数据。。我在表上做了个全文索引 。。使用了全文索引的USER_DATASTORE属性 在索引上 做了个过程。。这样实现了一个全文索引索引2个表字段的功能。。我测试了下 同步索引 ctx_ddl.sync_index 瞬间完成。。但是 ctx_ddl.optimize_index 确出奇的慢。。请问问题可能出现在哪里?是那个索引上的过程。。还是这个17W数据量本来就慢谢谢

解决方案 »

  1.   

    你换种方式试下呢?你把这个索引重建下。
    ctx_ddl.optimize_index有可能造成死锁
      

  2.   

    OPTIMIZE_INDEXUse this procedure to optimize the index. You optimize your index after you synchronize it. Optimizing an index removes old data and minimizes index fragmentation, which can improve query response time. Querying and DML may proceed while optimization takes place.You can optimize in fast, full, rebuild, token, or token-type mode.Fast mode compacts data but does not remove rows.Full mode compacts data and removes rows.Optimize in rebuild mode rebuilds the $I table (the inverted list table) in its entirety. Rebuilding an index is often significantly faster than performing a full optimization, and is more likely to result in smaller indexes, especially if the index is heavily fragmented.Rebuild optimization creates a more compact copy of the $I table, and then switches the original $I table and the copy. The rebuild operation will therefore require enough space to store the copy as well as the original. (If redo logging is enabled, then additional space is required in the redo log as well.) At the end of the rebuild operation, the original $I table is dropped, and the space can be reused.In token mode, you specify a specific token to be optimized (for example, all rows with documents containing the word elections). You can use this mode to optimize index tokens that are frequently searched, without spending time on optimizing tokens that are rarely referenced. An optimized token can improve query response time (but only for queries on that token).Token-type optimization is similar to token mode, except that the optimization is performed on field sections or MDATA sections (for example, sections with an <A> tag). This is useful in keeping critical field or MDATA sections optimal.A common strategy for optimizing indexes is to perform regular token optimizations on frequently referenced terms, and to perform rebuild optimizations less frequently. (Use CTX_REPORT.QUERY_LOG_SUMMARY to find out which queries are made most frequently.) You can perform full, fast, or token-type optimizations instead of token optimizations.Some users choose to perform frequent time-limited full optimizations along with occasional rebuild optimizations.
    Note:Optimizing an index can result in better response time only if you insert, delete, or update documents in your base table after your initial indexing operation.
    Using this procedure to optimize your index is recommended over using the ALTER INDEX statement.Optimization of a large index may take a long time. To monitor the progress of a lengthy optimization, log the optimization with CTX_OUTPUT.START_LOG and check the resultant logfile from time to time.
      

  3.   

    oracle 官方文档。。dba必备,呵呵小菜鸟同样有哈哈
      

  4.   

    -----你翻译反了吧,是建议使用alter index呀。。
    Using this procedure to optimize your index is recommended over using the ALTER INDEX statement
    使用此过程,以优化在您的索引,建议使用ALTER INDEX语句