which index is good ctxsys.context/ctxsys.CTXCAT [message #640099] |
Wed, 22 July 2015 05:34 |
|
mvrkr44
Messages: 132 Registered: December 2012
|
Senior Member |
|
|
hi All,
I have table which contains billion records,there was no index on one column.
1)create table test1(id number,name varchar2(250);
2)i inserted 5 million records in the above table.
3)Now i ran the query as below
select * from test1 where name like '%raj%';
it is going for full scan and executing more than 5 hours.
4)Now i tried to create index on this column using the below index
create index i_indexname on test1(name) indextype is ctxsys.context
Now i got output with in 15 minutes.
But is there any problem by using above index in Database side.
otherwise can anyone suggest any other method to implement the same.
Regards,
rajesh
|
|
|
|
|
|
|
|
|
|
|
Re: which index is good ctxsys.context/ctxsys.CTXCAT [message #640218 is a reply to message #640217] |
Thu, 23 July 2015 17:05 |
|
Barbara Boehmer
Messages: 9097 Registered: November 2002 Location: California, USA
|
Senior Member |
|
|
Apparently, Oracle still recommends sync(on commit) when using transactional. The following is an excerpt from online documentation.
"TRANSACTIONAL
Specifies that documents can be searched immediately after they are inserted or updated. If a text index is created with TRANSACTIONAL enabled, then, in addition to processing the synchronized rowids already in the index, the CONTAINS operator will process unsynchronized rowids as well. Oracle Text does in-memory indexing of unsynchronized rowids and processes the query against the in-memory index.
TRANSACTIONAL is an index-level parameter and does not apply at the partition level.
You must still synchronize your text indexes from time to time (with CTX_DDL.SYNC_INDEX) to bring pending rowids into the index. Query performance degrades as the number of unsynchronized rowids increases. For that reason, Oracle recommends setting up your index to use automatic synchronization with the EVERY or ON COMMIT parameter. (See "SYNC (MANUAL | EVERY "interval-string" | ON COMMIT)".)
Transactional querying for indexes that have been created with the TRANSACTIONAL parameter can be turned on and off (for the duration of a user session) with the PL/SQL variable CTX_QUERY.disable_transactional_query. This is useful, for example, if you find that querying is slow due to the presence of too many pending rowids. Here is an example of setting this session variable:
exec ctx_query.disable_transactional_query := TRUE;
If the index uses AUTO_FILTER, queries involving unsynchronized rowids will require filtering of unsynchronized documents."
|
|
|